Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Entry level Python programming question: 3. (3 points) Write a program that ask the user to enter five valid test scores. The program should display

Entry level Python programming question:

image text in transcribedimage text in transcribed

3. (3 points) Write a program that ask the user to enter five valid test scores. The program should display a letter grade for each score and the average test score. Write the following functions in the program: get_valid_score This function should ask the user to enter a score. If the score is less than 0 or greater than 100, the function should ask user re-enter a score, until user enter a valid one. Finally the function returns the valid score. calc_average This function should accept a list of test scores as argument and return the average of the scores. determine-grade This function should accept a test score as an argument and return a letter grade for the score base on the grading scale in Table 2a. Input Output Input Score Output Grade Score Grade Score (90 100 [80 90) [70 80 (60 70) 10 60) Grade A B C D F 97 89B 75 C 91 A 82 B 27 F -10 101 100 Invalid Input. Invalid Input. (a) 0 average 72.80 F B D 82 65 (b) average 68.80 (c) Test your program with the data in Tables 2b and 2c. Finally, format your program to match the sample terminal. Your output should exactly match the sample output, character for character, including all white space and punctuation. User input in the sample has been highlighted in Pappy's Purple to distinguish it from the program's output, but your user input does not need to be colored. Save your program as test_avg-grade.py Terminal $ python test_avg_grade.py Enter a score: 97 The letter grade for 97.0 is A. Enter a score: -10 Invalid Input. Please try again. Enter a score: 101 Invalid Input. Please try again. Enter a score: 100 The letter grade for 100.0 is A. Enter a score: 0 The letter grade for 0.0 is F. Enter a score: 82 The letter grade for 82.0 is B. Enter a score: 65 The letter grade for 65.0 is D. The average test score is 68.80

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

the situation when the data of operands are not available is called

Answered: 1 week ago