Question: The algorithm for calculating a GPA is to translate each letter grade to a number of quality points (A=4, B=3, C=2, D=1, E=0) and multiply
The algorithm for calculating a GPA is to translate each letter grade to a number of quality points (A=4, B=3, C=2, D=1, E=0) and multiply each grade by the number of credit hours for that class.
The total of these products is divided by the total number of credit hours. So the Sample Run 1 above would calculate as 4*4 + 3*3 + 3*4 + 4*2 = 45 for quality points and 4 + 3 + 3 + 4 = 14.0 credit hours. 45.0/14.0 = 3.21 (formatted to 2 places).
Note that classes CAN have a float number of credit hours! Special Cases: If the student has a GPA greater than 3.5 and 12 hours or more, they are on the Dean's List. If they have a GPA of less than 2.0, they are on Academic Probation. The program should handle upper or lower case letters for the grades. Do this without using any string functions (like .lower).
Use a boolean or operator. If the grade entered is not ABCDE or abcde, it's invalid - show a message about it and use 0 for the quality points. Use augmented operators as often as possible. Protect your program from division by zero!
in python please!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
