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,
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.
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 topherFirstMethodint numberArray AND public static int topherSecondMethodint numberArray as the method signatures.
Then write a test program that prompts the user to enter the 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.
Write a method that takes an array of ints size of as an argument. In the method create more arrays one of size and and another of size Put all of the values from the odd indices from the array of in the first array, and all the values from the even indices from the array of 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
