Question: In Java, 1 ) Write a method that takes an array of doubles, finds the average and sum of the doubles. The method should display

In Java,
1) Write a method that takes an array of doubles, finds the average and sum of the doubles. The method should display the sum and return the average which should be displayed back in the main method. Write a test program that demonstrates the method working.
2) Write a method that calls a second method that returns the index of the smallest element in an array of ints. If the number appears more than once in the array, return the smallest index. Use
public static int topherFirstMethod(int[] numberArray) AND public static int topherSecondMethod(int[] numberArray) as the method signatures.
Then write a test program that prompts the user to enter the 10 numbers, calls the first method, the first method calls the second method, the second method returns the value from the smallest index to the first method, and the first method returns the smallest index to the main method. The main method displays the smallest element's index.
3) Write a method that takes an array of ints (size of 25) as an argument. In the method create 2 more arrays one of size 12 and and another of size 13. Put all of the values from the odd indices from the array of 25 in the first array, and all the values from the even indices from the array of 25 in the second array. Display all three arrays, each on its own line with values separated by a single space.

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!