Question: Show me the steps to solve: The program will take a sequence of non - negative integers as well as a threshold value as input,

Show me the steps to solve:
The program will take a sequence of non-negative integers as well as a threshold value as input, then display whether each of the original inputs is greater than, less than, or equal to the threshold. In other words, your program should:
a) Create a sequence object (list) to accept user input
b) Using a while loop prompt the user to enter a sequence of non-negative integers, stored in the sequence object from the previous step.
o To indicate that they have entered the entire sequence, a user should input a
negative integer at which point the program will exit the while loop and commence
to the main algorithm.
c) Prompt the user to enter a threshold value
d) Using a for loop, display each number from the sequence and whether that
number is greater than, less than, or equal to the threshold value
Since there are multiple types of input, you MUST include prompts for your inputs.
Hint: You may also wish to use the input function, type casting, If/Elif/Else or continue statements, and comparison operators
Example:
Enter the next integer. Entering a negative integer will end the sequence: 6
Enter the next integer. Entering a negative integer will end the sequence: 570
Enter the next integer. Entering a negative integer will end the sequence: 10
Enter the next integer. Entering a negative integer will end the sequence: 0
Enter the next integer. Entering a negative integer will end the sequence: -1
Enter the threshold value: 10
6 is less than 10
570 is greater than 10
10 is equal to 10
0 is less than 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!