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, 24.06.2019 13:30
What is the most important for you to choose before you build a network?
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
What is a dashed line showing where a worksheet will be divided between pages when it prints? a freeze pane a split box a page break a print title
Answers: 1
question
Computers and Technology, 25.06.2019 04:20
Austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names. an unknown individual took control of austin's servers and transferred the domain names to another registrant without austin's permission. the new registrant began using the domain names to host malicious content—including hate letters to customers and fraudulent contact information—and to post customers' credit-card numbers and other private information, thereby tarnishing austin's goodwill. austin filed a suit in a federal district court against the new registrant under the anticybersquatting consumer protection act. is austin entitled to a transfer of the domain names? austin rare coins, inc., buys and sells rare coins, bullion, and other precious metals through eight web sites with different domain names
Answers: 3
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
Questions on the website: 13722363