Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program to calculate the letter grade from the numeric values entered by the user. Prompt the user to enter numeric scores out

Write a Python program to calculate the letter grade from the numeric values entered by the user.

Prompt the user to enter numeric scores out of 100 for 4 courses, and save the total score in a variable called totalscore.

Define a user designed function called calcgrade. This calcgrade function takes a parameter. You can name the parameter anything you like,for example it could be named rawscore.

The function should take this rawscore and divide it by 4. The function should then calculate and return the letter grade based on the value obtained from the division

If the value is >= 90, letter grade is A

if the value is >= 80, letter grade is B

if the value is >= 70, letter grade is C

if the value is >= 60, letter grade is D

else letter grade is F

Program should print the raw score and the letter grade.

Note: When you call the function, remember to use the variable that stores the total of all four courses, if you used the name totalscore, then your function call would be something like

calcgrade(totalscore)

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books