subject

Write a java code to accept an integer array of user-defined length from the user. Then write methods to take care of the following tasks. Check your methods in the main method of your program (3 points). A method that finds the sum of the maximum value and the minimum value among all the elements of the array. (3 points)
Example: 10 15 4 19 2 12
The maximum value is 19 and the minimum value is 2. So the output should be 21.
A method that finds the largest gap between any two elements of the array. (4 points)
Example: 3 6 7 10
The largest gap can be found between 3 and 10 which is 10 - 3 = 7, hence the output 7.
A method that finds the Length of the Longest Arithmetic Progression in it. (5 points)
Example: 1 7 10 15 27 29
The Longest Arithmetic Progression in the array is {1, 15, 29}, and its length is 3, hence the out

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 23.06.2019 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Stops: using the information learned in this course, explain three things you will not do when driving. a. b. c. explain why you will not do these things when driving. starts: using the information learned in this course, explain three things you will do when driving. a. b. c. explain why you will do these particular things when driving. explain one thing you will stop doing as a passenger. explain one thing you will start doing as a passenger.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
You know the right answer?
Write a java code to accept an integer array of user-defined length from the user. Then write method...
Questions
question
Chemistry, 04.05.2021 08:00
question
Mathematics, 04.05.2021 08:00
question
Mathematics, 04.05.2021 08:00