Due: Tuesday, October 8, 2013
Write methods that do the following things. You can put all of these methods into a single program for easy organization. I'm not specifically requiring you to write a main method but you might want to just to test the methods below (by calling them).
A method findMax that takes an array of integers and returns the maximum integer in the array.
A method findString that takes an array of strings and a search string (in other words, two parameters) and returns the index in the array of the first string that matches the search string. Return -1 if there is no match. Be sure to use the equals to compare string values.
A method flip that takes an array of integers and returns them in reverse order. For example if given an array { 1, 2, 3 } it should modify it to contain { 3, 2, 1 }. Your method should change the array in place (technically the method returns void).
A method flipNonMutating that works like flip except that it should not change the given array and instead return a new array with everything in reverse order.
Last Revised: 2013-10-01
© Copyright 2013 by Peter C. Chapin
<PChapin@vtc.vsc.edu>