Write a C++program (using cout and cin) that calculates a student's GPA. Ask the user to enter grade and also the credit hours of the course in a loop until user enter “N” or “n”. Earned points in that course becomes Grade point * credit hours i.e., Earned points = Grade point*credit hours Grade points of each grade are as follows Grade Grade Points A 4 B 3 C 2 D 1 F 0     Example: You got “A” grade in Computer Programming theory course and the credit hours are 3. So your earned grade points=4*3=12 Similarly if you get “C” grade in another subject e.g., Computer Fundamentals and the credit hours are also 3 here. Now earned grade points = 2*3=6 If you get “B” grade in Circuit and Systems theory and the credit hours are 3. So your earned grade points=3*3=9   Now your GPA = (12+6+9) / 9 = 3 GPA formula is: GPA=Sum of earned points in all subjects / Total credit hours

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter14: Numerical Methods
Section: Chapter Questions
Problem 4PP
icon
Related questions
icon
Concept explainers
Question

Write a C++program (using cout and cin) that calculates a student's GPA. Ask the user to enter grade and also the credit hours of the course in a loop until user enter “N” or “n”. Earned points in that course becomes Grade point * credit hours i.e.,

Earned points = Grade point*credit hours

Grade points of each grade are as follows

Grade

Grade Points

A

4

B

3

C

2

D

1

F

0

 

 

Example:

You got “A” grade in Computer Programming theory course and the credit hours are 3. So your earned grade points=4*3=12

Similarly if you get “C” grade in another subject e.g., Computer Fundamentals and the credit hours are also 3 here. Now earned grade points = 2*3=6

If you get “B” grade in Circuit and Systems theory and the credit hours are 3. So your earned grade points=3*3=9

 

Now your GPA = (12+6+9) / 9 = 3

GPA formula is:

GPA=Sum of earned points in all subjects / Total credit hours

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr