Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Generative Artificial Intelligence For Project Management With Aws

Authors: Timothy Krimmel

1st Edition

B0CQV9KWB8, 979-8872627197

More Books

Students also viewed these Databases questions

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago

Question

11. Are your speaking notes helpful and effective?

Answered: 1 week ago

Question

The Goals of Informative Speaking Topics for Informative

Answered: 1 week ago