1. Engineering
  2. Computer Science
  3. write a python program to calculate the letter grade from...

Question: write a python program to calculate the letter grade from...

Question details

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


Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution