Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Q: Do you carry out PAs?

Answered: 1 week ago

Question

Write the difference between sexual and asexual reproduction.

Answered: 1 week ago

Question

What your favourite topic in mathematics?

Answered: 1 week ago

Question

Briefly describe vegetative reproduction in plants.

Answered: 1 week ago

Question

7. Determine what feedback is provided to employees.

Answered: 1 week ago