Write a C++ (use cout and cin )program 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

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.4: For Loops
Problem 11E
icon
Related questions
icon
Concept explainers
Question

Write a C++ (use cout and cin )program 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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,