Question: In python language, write the following. High school assignment - please keep simple I nstructions Write a program that prompts the user to input a
In python language, write the following. High school assignment - please keep simple
Instructions
Write a program that prompts the user to input a letter grade in either capital or lowercase. Your program should then output the correct number of the GPA. See the table below for possible inputs and expected outputs. Your program should define at least one function named GPAcalc that is called from your main program.
The GPAcalc function should take exactly one parametera string for the letter grade as lower or upper case. It will return either an integer for the GPA value or a string, Invalid, if the letter grade parameter is invalid.
| Input: Letter Grade | Expected output: GPA value |
| A or a | 4 |
| B or b | 3 |
| C or c | 2 |
| D or d | 1 |
| F or f | 0 |
| Anything else | Invalid |
Sample Run 1
Enter your Letter Grade: a
Your GPA score is: 4
Sample Run 2
Enter your Letter Grade: A
Your GPA score is: 4
Sample Run 3
Enter your Letter Grade: C
Your GPA score is: 2
Sample Run 4
Enter your Letter Grade: G
Your GPA score is: Invalid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
