Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a program with a main() method that asks the user to input an integer array of 10 elements. Next, create three methods described below. From

a program with a main() method that asks the user to input an integer array of 10 elements. Next, create three methods described below. From inside your main() method, call each of the three methods described below and print out the results of the methods 2, 3, which return values.

  1. printReverse() - a method that receives an array of integers, then reverses the elements of the array and prints out all the elements from inside the method. Print all in one line separated by commas (see sample output below).

  1. getLargest() a method that receives an array of integers, then returns the largest integer value in the array. (print result from main() )

  1. computeTwice() - a method that receives the previously reversed array of integers, then returns an array of integers which doubles the value of each number in the array (see the sample output below). (print result from main() )

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 valued element: 99

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

More Books

Students also viewed these Databases questions

Question

Assess the requirements for strategic LMD

Answered: 1 week ago

Question

2. What do you believe is at the root of the problem?

Answered: 1 week ago