Write a program that takes an indefinite amount of numbers


LAB Assignment: Find the second largest number

Write a program that takes an indefinite amount of numbers as input and outputs the next largest number to the screen after the user is finished entering numbers and would like to exit.

An example of user interaction with the program is shown below:

Please enter a positive number (type -1 to exit): 99
Please enter a positive number (type -1 to exit): 42
Please enter a positive number (type -1 to exit): 73
Please enter a positive number (type -1 to exit): 24
Please enter a positive number (type -1 to exit): 444
Please enter a positive number (type -1 to exit): 324
Please enter a positive number (type -1 to exit): 20
Please enter a positive number (type -1 to exit): -1

The second largest number entered is: 324

The zipped file to turn in must include:

• txt: a brief text file describing the design of your program, i.e. the steps required for the calculation.
• interactive.py: the source code using standard input/output.
• interactive.scr: the typescript file to show that your program works with the example input provided above.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Write a program that takes an indefinite amount of numbers
Reference No:- TGS02457497

Now Priced at $30 (50% Discount)

Recommended (95%)

Rated (4.7/5)