Any tips would be greatly appreciated. Thank you very much for your time.
// Include statements
#include <iostream>
using namespace std;
// Main function
int main ()
{
//Collect and assign variables for grades and credit hours.
int grade1 =0;
int grade2 =0;
int grade3 =0;
int grade4 =0;
int grade5 =0;
int hours1 =0;
int hours2 =0;
int hours3 =0;
int hours4 =0;
int hours5 =0;
cout << "Welcome to Heather's GPA calculator. This will work for 5 grades." << endl;
cout << "Please enter your first grade. A=4, B=3, C=2, D=1, F=0" << endl;
cin >> grade1;
cout << "How many credit hours is this course?" << endl;
cin >> hours1;
cout << "Please enter your second grade. A=4, B=3, C=2, D=1, F=0" << endl;
cin >> grade2;
cout << "How many credit hours is this course?" << endl;
cin >> hours2;
cout << "Please enter your third grade. A=4, B=3, C=2, D=1, F=0" << endl;
cin >> grade3;
cout << "How many credit hours is this course?" << endl;
cin >> hours3;
cout << "Please enter your fourth grade. A=4, B=3, C=2, D=1, F=0" << endl;
cin >> grade4;
cout << "How many credit hours is this course?" << endl;
cin >> hours4;
cout << "Please enter your fifth grade. A=4, B=3, C=2, D=1, F=0" << endl;
cin >> grade5;
cout << "How many credit hours is this course?" << endl;
cin >> hours5;
return 0;
}

New Topic/Question
Reply


MultiQuote



|