Question: Problem 2 (Arrays): In the same package, create another Java class and call it Problem_2. Solve the following problems: 1. Write a method to print

 Problem 2 (Arrays): In the same package, create another Java class

Problem 2 (Arrays): In the same package, create another Java class and call it Problem_2. Solve the following problems: 1. Write a method to print an array of double values 10 elements in each row. public void printArray (double[] arr) In the main method, create an array of double of size =30 and print it. 2. Write a method that takes an array of double and initializes it to random numbers between a minimum value and a maximum value public void fillArray (double[] arr, double min, double max) In the main method, fill this array with random numbers between 20 and 200, then print it. 3. Write a method that returns the average of an array of double numbers with the following headers: public static double averagel double[] array) In the main method display the average of the numbers in your array. 4. Write a method that finds the largest element in an array of double values public static double largest(double() array) In the main method, find and print the largest value in the array 5. Write a method that finds the smallest element in an array of double values public static double smallest(double[] array) In the main method, find and print the smallest value in the array 6. Write a method that returns true if list is sorted, using the following header: public static boolean issorted int() list) In the main method, create two arrays of 5 elements, and fill them one with sorted elements and another with unsorted elements. Test both arrays to see if they are sorted or not and print the result

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 Databases Questions!