CSCI120A Lab 4B Fall 2008 Semester ----------------------------------- Write a program to read a list of non-negative integers, and to display the largest integer, the smallest integer, and the average of all the integers. The user indicates the end of the list by entering a negative sentinel value (use -1) that is NOT used in the calculations. The average should be displayed as a value of type float, to three decimal places (see example program 05-13.py). The program should repeat at the user's request. (see example program 05-14.py). For important programming hints, see: ___________________________________ www.annedawson.net/PythonHints.html ___________________________________ ******************************************************* For this assignment, writing an algprithm is optional. Save your file (completed or not) as yourname.py (e.g. annedawson.py) to the following network folder: CSCI on Pineapple\Anne Dawson\CSCI120A\Week04\LAB4B before the end of today's class. ******************************************************* EXAMPLE PROGRAM RUNS: Example 1 --------- Please enter a list of whole numbers. Press the enter key after entering each number. Signal the end of the list by entering a negative number: 37 10 41 33 25 -1 You entered 5 numbers. The largest number is: 41 The smallest number is: 10 The average of the numbers is: 29.200 Do you want to run this program again? (y/n) Y Please enter a list of whole numbers. Press the enter key after entering each number. Signal the end of the list by entering a negative number: 17 19 49 2 66 6 -1 You entered 6 numbers. The largest number is: 66 The smallest number is: 2 The average of the numbers is: 26.500 Do you want to run this program again? (y/n) n Thank you for using this program. Goodbye! *************************************************************** Test your program by entering the example numbers shown above. *************************************************************** ******************************************************* For this assignment, writing an algprithm is optional. Save your file (completed or not) as yourname.py (e.g. annedawson.py) to the following network folder: CSCI on Pineapple\Anne Dawson\CSCI120A\Week04\LAB4B before the end of today's class. *******************************************************