Question: Follow the instructions and do a complete Java code with no errors. And give explanation. Introduction and Background As we discussed in lecture, arrays can


Follow the instructions and do a complete Java code with no errors. And give explanation.

Introduction and Background As we discussed in lecture, arrays can be veryuseful data structures. We already discussed how to load items into an

Introduction and Background As we discussed in lecture, arrays can be very useful data structures. We already discussed how to load items into an array and how to search an array for an item. In this lab you will implement a number of other useful operations that can be done on arrays. You will then write a simple main program to utilize your methods. For help with this lab, see course notes for Lecture 11 and handouts ex11.java and ex12a.java Lab Exercise You are to write the following 4 methods: public static double [] getData (Scanner input) // Create an array from user input // then return the new array. The user will input the size of the array // and the data that will go into the array. Note the return type. public static double max (double [] data) public static double sum (double [] data) public static double ave (double [] data) // return the maximum value in the // array. // sum the items in the array // and return the result // call sum to get the sum // and then return the average Once you have completed the methods above, write a simple main program that does the following: 1) Calls the getData() method to generate, input and return a new array (note parameter and return value) 2) Calls the max, sum and ave methods to get those values and prints them all out in a nicely formatted way Grading and Submission Once you have your program working, notify your TA so you can demonstrate it to them: Run your program for your TA, demonstrating that all of your methods work properly. Also, briefly show your code to your TA so they can verify that you used methods for your implementation. There will be 4 raw points for this lab, broken down in the following way.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!