Question: Write a Python program that prompts the user for the number of classes taken and then for each class, the letter grade received (e.g. B+)
Write a Python program that prompts the user for the number of classes taken and then for each class, the letter grade received (e.g. B+) and the number of credits (e.g. 3). Once this information is known, the program should calculate and display the GPA, and the values are: A (4.0), A- (3.7), B+ (3.3), B (3.0), B- (2.7), C+ (2.3), C (2.0), C- (1.7), D+ (1.3), D (1.0) and F (0.0). Assumptions: The user will take at least one and no more than seven courses. Each course has a credit value between one and five (inclusive). A grade can be entered in uppercase or lowercase. For example, either A- or a-. All user inputs will be valid.
Your solution should match this output format exactly:
Enter the number of courses you are taking: 4 Enter grade for course 1: A Enter credits for course 1: 4 Enter grade for course 2: b- Enter credits for course 2: 3 Enter grade for course 3: B+ Enter credits for course 3: 3 Enter grade for course 4: A- Enter credits for course 4: 1 Your GPA is 3.43
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
