I have 3 programs that i need to write. All including arrays.
First one is:
Complete the method named averagePrice, in the program below, named Prices.java, so that it accepts an array of prices as a parameter, and returns the average price. You may assume all prices are double values.
Second one is:
Complete the method named middleValue, in the program below, named ArrayOps.java, so that it accepts an array of integer values as a parameter, and returns the value in the middle of the array.
For instance, if an array contains five elements, then the third element would be the middle element to be returned. However, if the array contains six elements, both the third and fourth values could be considered to be the middle elements. In this case, only return the first middle value, namely, the third element of the array.
Third one is:
Complete the method, named findValue, in the class named ArrayOps.java. There are two parameters to this method: the first is an integer array and the second is a integer value.
This method should use a linear search to try to find an instance of the integer value parameter within the array. If the value is in the array, the method returns the subscript of the array where the value was found. If the value is not in the array, the value of the length of the array is returned (as that is a higher value than any of the array subscripts).
My issue that im having is where do i even start. I could probably to this without methods, but once methods get involved i become lost. Also how do i make the array without being given an array size and/or prompting the user for the array size. If anyone can direct me in the correct direction or if you have done these programs please share your knowledge! =)