Question: Create a program that will calculate a students GPA using switch statements. The program should prompt the user for the number of courses (which determines

Create a program that will calculate a students GPA using switch statements. The program should prompt the user for the number of courses (which determines a for loop counter). Then the program will ask for the letter grade (string variable) and the credit hours for that course. It will take those inputs and then calculate the students GPA based on the following 4.0 grading scale. Add the credit hours and the grade point hours on each pass through the loop. Upon completion of the loop, calculate the final grade point average (grade point hours/credit hours).

Hint: keep 2 scalar running totals in the loop: (1) total_hours, and (2) total_earned

Letter Grade

Grade Points

A

4.0

A-

3.7

B+

3.3

B

3.0

B-

2.7

C+

2.3

C

2.0

Letter Grade

Grade Points

C-

1.7

D+

1.3

D

1.0

D-

0.7

E

0.0

Test your program with the following two cases:

A, B- , B+ with credit hours [3 5 5]

B+, C-, D with credit hours [5 4 3]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!