``````#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main()
{

cout << " WELCOME TO GPA CALCULATOR \n\n"<< endl;
int x, nument;
float GPA, TotalHrs = 0, GEP = 0, CrHours, X, Y, TotalPts;
char Grade, A, B, C, D, E, F;
char choice = 'Y';
cout << "Enter the amount of course. \n";
cin >> nument;
for (int i = 1; i <= nument; i++) {

cout << "Enter the Grade of the course.  ";
{
case'A':
case'a':
GEP = 4;
break;
case'B':
case'b':
GEP = 3;
break;
case'C':
case'c':
GEP = 2;
break;
case'D':
case'd':
GEP = 1;
break;
case'F':
case'f':
GEP = 0;
break;
default:
cout << "Invalid Input \n";
break;
}

cout << "Enter the credits of the course.  ";
cin >> CrHours;
X = ((GEP) * (CrHours));
TotalPts += X;
TotalHrs = TotalHrs + CrHours;
GPA = TotalPts / TotalHrs;
Y = TotalHrs * 4;
}
{
cout << endl;
cout << "You want to entry more ? (Y/N) ";
cin >> choice;
cout << endl;
}
while (choice == 'Y' || choice == 'y') {
cout << "Enter the Grade of the course.    ";
cout << "Enter the credits of the course.  ";
cin >> CrHours;
if
GEP = GEP + 4;
if
GEP = GEP + 3;
if
GEP = GEP + 2;
if
GEP = GEP + 1;
if
GEP = GEP + 0;
else
{
cout << "Invalid entry. Please enter A,B,C,D or F \n";
}
X =  GEP + TotalHrs ;
Y = TotalHrs * 4;

TotalHrs = TotalHrs + CrHours;
GPA = TotalPts / TotalHrs;
{
cout << endl;
cout << "You want to entry more ? (Y/N) ";
cin >> choice;
cout << endl;
}
}
cout << "Total credits Attempted: \n" << TotalHrs;
cout << "  " <<endl;
cout << "Possible obtain points: \n" << Y;
cout << "  " << endl;
cout << "Obtained Points " << X ;
cout << "  " <<endl;
cout << "Your GPA is: \n" << GPA;
cout << "  " <<endl;
{
cout << "Press X for quit. \n";
cin >> x;
cout << endl;
return (0);
}
}``````