Problem Statement for High and Low Design a program that lets the user enter a series of numbers. The user should enter -99 to signal the end of the series. After all the numbers have been entered, the program should display the highest and lowest number in the series. Part 1. Understand the Problem The program will use a while loop to get the numbers from the user. It is not necessary for the individual numbers to be saved;each number can be evaluated as it is read in. To find the highest and lowest number in the series, use two variables. The variables are initialized by getting the first number from the user and assigning it to both the highest and lowest variables. The assumption is, that if there is only one number in the series it is both the highest and lowest numbers. Inside the loop, each number should be compared to the value stored in the highest variable and its value should replace the value in highest variable if it is greater than the number already there. The same can be done for the lowest variable, except the number is reassigned only if it is less than the number already there.After the comparison are done, prompt the user for the next number to input. The loop is controlled by the number read in andwill terminate when a sentinel value (in this case -99) is input by the user. Remember that the only way a computer can make this test is by comparing the value of two numbers (in this case for equality) and returning a result of true if the comparison succeeds or false if the comparison fails. The number to be compared to the input is called the sentinel value and is assigned to a variable at the beginning of the program.After reading in the first number, your prompt should tell the user what the exact sentinel value is to end the loop.Once the loop is terminated, display the values in the highest and lowest variables. To test the program, enter a series of numbers ending with -99 and verify that the program displays the highest and lowest values in the series. For example, if the user enters 3 5 1 7 8 4 9 2, the highest would be 9 and the lowest would be 1. (PYTHON)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Problem Statement for High and Low

Design a program that lets the user enter a series of numbers. The user should enter -99 to signal the end of the series. After all the numbers have been entered, the program should display the highest and lowest number in the series.

Part 1. Understand the Problem

The program will use a while loop to get the numbers from the user. It is not necessary for the individual numbers to be saved;each number can be evaluated as it is read in.

To find the highest and lowest number in the series, use two variables. The variables are initialized by getting the first number from the user and assigning it to both the highest and lowest variables. The assumption is, that if there is only one number in the series it is both the highest and lowest numbers.

Inside the loop, each number should be compared to the value stored in the highest variable and its value should replace the value in highest variable if it is greater than the number already there. The same can be done for the lowest variable, except the number is reassigned only if it is less than the number already there.After the comparison are done, prompt the user for the next number to input.

The loop is controlled by the number read in andwill terminate when a sentinel value (in this case -99) is input by the user. Remember that the only way a computer can make this test is by comparing the value of two numbers (in this case for equality) and returning a result of true if the comparison succeeds or false if the comparison fails.

The number to be compared to the input is called the sentinel value and is assigned to a variable at the beginning of the program.After reading in the first number, your prompt should tell the user what the exact sentinel value is to end the loop.Once the loop is terminated, display the values in the highest and lowest variables.

To test the program, enter a series of numbers ending with -99 and verify that the program displays the highest and lowest values in the series. For example, if the user enters 3 5 1 7 8 4 9 2, the highest would be 9 and the lowest would be 1.

(PYTHON)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education