Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Kindly use Python programming . Please share code and picture of output as shown in the question instruction (to help with understanding) Write a program

Kindly use Python programming. Please share code and picture of output as shown in the question instruction (to help with understanding)image text in transcribed

Write a program that asks the user to enter avalid score five times. The program should display a letter grade after each score is entered. After all the scores are entered, it should display the average of the scores and the letter grade corresponding to that average. Complete your program by writing the following three functions and calling them from within your nain function. zet_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 the user to re-enter a score, until the user enters a valid one. Finally, the function returns the valid score. calc_average. This function should accept a list of scores as its only argument and return the average of the scores, It should be able to handle lists of any length. determine_grade This function should accept a score as an argument and return a letter grade for the score based on the grading scale in Table 1a. Table 1: The grading scale (a), and two test cases (b), and (c) for exercise 04.3. Test your program with the data in Tables 1b and 1c. Finally, format your program to 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 avg_grade_login.py, where login is your Purdue login. Then submit it along with a sereenshot showing a run of both test cases, Terminal $ python avg_grade_login.py Enter a score: 93 The letter grade for 93.0 is A. Enter a score: 7 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: 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. Results: The average score 1s 68. 00 . The letter grade for 68.001sD

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

3. What strategies might you use?

Answered: 1 week ago

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago