Question
Write a program that contains the following functions: - a function that will ask the user for a test score. Only scores from 0 to
Write a program that contains the following functions:
- a function that will ask the user for a test score. Only scores from 0 to 100 are valid. If the user enters an invalid score, the function should ask them again for a valid score. The function should catch any exceptions that could be generated if the user enters non-numeric data. Once a valid score is entered, the function should return that score.
- a function that will accept a list of numbers and return the average.
The program should ask the user for three test scores, using the function described above to get valid scores. The program should then put those scores in a list and call the other function described above to get the average score. Finally, the program should display that average to the user.
Full credit if you use a loop so the number of scores can easily be changed, for example from 3 to 4, by just modifying a single parameter. Most of the credit even if it's not a loop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started