Ok, the program allows me to input every value and everything executes, but heres what comes back when the calculations at the bottom are supposed to happen. take a look. Please help?
For your 1st class please select the appropriate number for your grade.
For an A, select 1.
For a B, select 2.
For a C, select 3.
For a D, select 4.
For an F, selcet 5.
Please enter your selection --> 2
Please enter number of credit hours for first class --> 3
For your 2nd class please select the appropriate number for your grade.
For an A, select 1.
For a B, select 2.
For a C, select 3.
For a D, select 4.
For an F, selcet 5.
Please enter your selection --> 3
Please enter number of credit hours for second class --> 4
8
0
Your GPA is --> 1.14286
You are doing poorly.
Press any key to continue . . .
Notice above where the single value 8, well thats Points_1 and it should be 9.
And above the single value 0, well thats Points_2 and it should be 8.
Also above the GPA value should be 2.42875
#include <iostream>
using namespace std;
void main ()
{
int LetterGrade_1 = 0, LetterGrade_2 = 0;
double TotalPoints = 0, TotalCreditHours = 0, CreditHours_2 = 0, GPA = 0;
double CreditHours_1 = 0, Points_1 = 0, Points_2 = 0;
cout << "For your 1st class please select the appropriate number for your grade.";
cout << endl;
cout << "For an A, select 1." << endl;
cout << "For a B, select 2." << endl;
cout << "For a C, select 3." << endl;
cout << "For a D, select 4." << endl;
cout << "For an F, selcet 5." << endl;
cout << "Please enter your selection --> ";
cin >> LetterGrade_1;
cout << endl;
switch (LetterGrade_1)
{
case 1:
cout << "Please enter number of credit hours for first class --> ";
cin >> CreditHours_1;
cout << endl;
Points_1 = 4 * CreditHours_1;
break;
case 2:
cout << "Please enter number of credit hours for first class --> ";
cin >> CreditHours_1;
cout << endl;
Points_1 = 3 * CreditHours_1;
break;
case 3:
cout << "Please enter number of credit hours for first class --> ";
cin >> CreditHours_1;
cout << endl;
Points_1 = 2 * CreditHours_1;
break;
case 4:
cout << "Please enter number of credit hours for first class --> ";
cin >> CreditHours_1;
cout << endl;
Points_1 = CreditHours_1;
break;
case 5:
cout << "Please enter number of credit hours for first class --> ";
cin >> CreditHours_1;
cout << endl;
Points_1 = 0;
break;
}
cout << "For your 2nd class please select the appropriate number for your grade.";
cout << endl;
cout << "For an A, select 1." << endl;
cout << "For a B, select 2." << endl;
cout << "For a C, select 3." << endl;
cout << "For a D, select 4." << endl;
cout << "For an F, selcet 5." << endl;
cout << "Please enter your selection --> ";
cin >> LetterGrade_2;
cout << endl;
switch (LetterGrade_2)
{
case 1:
cout << "Please enter number of credit hours for second class --> ";
cin >> CreditHours_2;
cout << endl;
Points_1 = 4 * CreditHours_2;
break;
case 2:
cout << "Please enter number of credit hours for second class --> ";
cin >> CreditHours_2;
cout << endl;
Points_1 = 3 * CreditHours_2;
break;
case 3:
cout << "Please enter number of credit hours for second class --> ";
cin >> CreditHours_2;
cout << endl;
Points_1 = 2 * CreditHours_2;
break;
case 4:
cout << "Please enter number of credit hours for second class --> ";
cin >> CreditHours_2;
cout << endl;
Points_1 = CreditHours_2;
break;
case 5:
cout << "Please enter number of credit hours for second class --> ";
cin >> CreditHours_2;
cout << endl;
Points_1 = 0;
break;
}
cout << Points_1 << endl << Points_2 << endl << endl;
TotalPoints = Points_1 + Points_2;
TotalCreditHours = CreditHours_1 + CreditHours_2;
GPA = TotalPoints / TotalCreditHours;
cout << "Your GPA is --> " << GPA << endl;
// I only put this here to illustrate what its doing.
if (GPA < 2.0)
{
cout << "You are doing poorly." << endl << endl;
}
else if (GPA >= 3.5)
{
cout << "Congratulations, doing good." << endl << endl;
}
}