Question
This program should mainly use functions. Design a Python program to get 3 test scores, calculate the average score, and assign a letter grade by
This program should mainly use functions.
Design a Python program to get 3 test scores, calculate the average score, and assign a letter grade by following the grade scale:
Average score Letter Grade 90 or greater A between 80 and 90 B between 70 and 80 C between 60 and 70 D below 60 F
The program should have the following functions:
get_scores: this function returns three test scores entered by the user. This function should perform input validation and only accept positive values test scores, and ask the user to reenter for any invalid score (negative)
calculate_average: this function takes 3 test scores as parameters and returns the average score
assign_grade: this functions takes the average score as a parameter and returns a letter grade
show_results: this functions take the average score and letter grade as parameters and displays the results (average score and assigned letter grade)
The main function of this program calls the above functions.
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