Programming Lab Project
CS A131 Fall 2017 MW 2:20-4:50p/6:00-8:30p LAB03 100pts Due: Wed 9/27/2017 11:59PM
LAB03: 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:
• lab03.txt: a brief text file describing the design of your program, i.e. the steps required for the calculation.
• lab03 interactive.py: the source code using standard input/output.
• lab03 interactive.scr: the typescript file to show that your program works with the example input provided above.
Submit the lab04.tar.gz to blackboard by the due date on top of this page.
1