Computing Science 120.s10 Assignment #2
Page 1 of 3
Objectives: Learn how to solve a problem using top-down design. Practice in programming conditions using the Boolean operator and variables. Practice in using procedures/functions. Gain practice in building up a library of routines. Appreciate the importance of data validation.
Description of the problem: Title of this program: Lowest Test-Score Drop
Write a Python program that calculates the average of a group of test scores where the lowest score in the group is dropped.
Requirements: This program must use the following functions:
- def main() is like a main menu. It will call the getScore() function to get the four test scores by asking the user. It will get rid of the lowest test score with the help of the findLowest() function. It will calculate the average of the three highest scores with the help of the calcAverage() function.
- def getScore() should ask the user for a test score and return a validated test score that is not lower than 0 or higher than 100. This function should be called by the main() function once for each of the four scores to be entered.
- def findLowest() should find and return the lowest of the four scores passed to it. It should be called by the main() function, which uses this function to determine which one of the four scores to drop.
- def calcAverage() should accept the three highest scores and calculate their average. This function should be called just once by the main() function, which passes the three highest scores to it. You may insert any additional functions if necessary.
Items to be handed in:
- An algorithm for this program
- A copy of your program's Python source code and at least one complete sample run
- Your filename must be: ####assign2 where #### is the last four digits of your student number.