Programming Exercise 13 |
< Previous Next > |
The Fork Spring Golf Club has a completed their tournaments and now the club president asked you to write another program. This program will read the previously written scores from a file and then determine the winning player and score (lowest score wins). The program should contain a main() function which prompts the user for the input file name. This program will then call the function scored(inFile) where inFile is the file object. The scored() function should then read through the player data to find the winner and their score. This data should then be printed to standard output. The function should return the average score to main() which will be printed to standard output. The main() function should close the input file.
Sample Input FilePlease enter the name of file for processing: golf.txt The winner of the tournament is Marie with a score of 21! The average for the tournament is 32.0
Please enter the name of file for processing: golfB.txt The winner of the tournament is Mary with a score of 76! The average for the tournament is 88.0
handin pe13 pe13.pyTo verify your submission, type the following in a terminal window:
handin pe13