Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a program that asks the user to enter a series of numbers. The user should enter -99 to signal the end of the series.

Design a program that asks the user to 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 largest and smallest numbers entered. Do not put the numbers in a list or use the Python supplied functions to find the minimum and maximum values in a list.

Before writing any code, analyze the problem. As described in the examples for Python Programming Tutorials, Lesson 4, identify the inputs to the program and outputs coming from the program. Describe the processing as a logical sequence of steps (i.e., an algorithm). Summarize the analysis in the form of an IPO chart and include the IPO chart as comments at the top of your source code (.py) file. IPO chart comments are illustrated in the examples for Lesson 4.

Here is an algorithm you can use:

Write "Enter a number (enter -999 to end)"
Get number
highest = number
lowest = number
While (number != -999)
 if (number > highest)
 highest = number
 if (number < lowest)
 lowest = number
 Write "Enter a number (enter -999 to end)"
 Get number
Write "The highest number is ", highest
Write "The lowest number is ", lowest

Convert this algorithm into a Python script inside of a def main(): module as shown in Lesson 4. Run the program in Pep 8 to make sure it produces the results you expected.

Turn in:

Source code (.py script) with IPO comments

Screen shot of testing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions