1. The maximum difference between any two subsequent (right next to each other) numbers in the list 2. The longest increasing section of the list. For example, in the sequence 5, 1, 2, 19, 9, 20, the longest increasing section is: 1, 2, 19. (The 20 is not included in this section since it doesn't come immediately after the 19.) Here is a sample run of the program (user input is in red): Enter a list of numbers separated by spaces: 5 1 2 19 9 20 Maximum difference: 2 and 19 ing section:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Write a Java program that gets a list of numbers from the user and prints:
1. The maximum difference between any two subsequent (right next to each other)
numbers in the list
2. The longest increasing section of the list. For example, in the sequence 5, 1, 2,
19, 9, 20, the longest increasing section is: 1, 2, 19. (The 20 is not included in
this section since it doesn't come immediately after the 19.)
Here is a sample run of the program (user input is in red):
Enter a list of numbers separated by spaces: 5 1 2 19 9 20
Maximum difference: 2 and 19
Longest increasing section:
1 2 19
Transcribed Image Text:1. The maximum difference between any two subsequent (right next to each other) numbers in the list 2. The longest increasing section of the list. For example, in the sequence 5, 1, 2, 19, 9, 20, the longest increasing section is: 1, 2, 19. (The 20 is not included in this section since it doesn't come immediately after the 19.) Here is a sample run of the program (user input is in red): Enter a list of numbers separated by spaces: 5 1 2 19 9 20 Maximum difference: 2 and 19 Longest increasing section: 1 2 19
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning