Question
An increasing sequence of numbers is one in which each number is larger than the one before it. For example, [4, 8, 13, 14, 21]
An increasing sequence of numbers is one in which each number is larger than the one before it. For example, [4, 8, 13, 14, 21] is an increasing sequence, but [4, 8, 13, 12, 21] is not. Write a program that repeatedly reads positive integers from the user. Your program should track the length of the longest increasing sequence of numbers that the user has entered and display it when the user has finished entering numbers. The user is finished entering numbers when they input q or when they enter a decreasing sequence of numbers (i.e., each number is lower than the previous) of length 3.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started