Question: Write a program with a main method that asks the user to enter an array of 10 integers. Your main method then calls each of

Write a program with a main method that asks the user to enter an array of 10 integers. Your main method then calls each of the three methods described below and prints out the results of the two methods which return values.

printReverse - a void method that reverses the elements of the array and prints out all the elements in one line separated by commas (see sample output below).

getLargest - an int method that returns the largest value in the array.

computeTwice- a method that returns an array of int which contains 2 times of all the numbers in the array (see the sample output below).

Sample output:

Enter a number:

22

Enter a number:

34

Enter a number:

21

Enter a number:

35

Enter a number:

12

Enter a number:

4

Enter a number:

2

Enter a number:

3

Enter a number:

99

Enter a number:

81

Here the array in reverse: 81, 99, 3, 2, 4, 12, 35, 21, 34, 22

The highest number is 99

The array with two times the numbers: [162, 198, 6, 4, 8, 24, 70, 42, 68, 44]

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!