RSS

LAB03: Find the second largest number

27 Sep

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

 
Leave a comment

Posted by on September 27, 2017 in Academic Writing

 

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: