I know something is missing from this program, but I'm very new at this and can't figure it out. Could anyone help?
It should prompt the user to input 6 GPA's, but instead when you enter the first GPA it gives you the same answer six times.
Code:include <iostream> #include <string> #include <cstdlib> using namespace std; void instructions(); void displayGradeMsg(); //-------------------------------------- int main () { // Instructions for the user. instructions(); // Determines the message. displayGradeMsg(); displayGradeMsg(); displayGradeMsg(); displayGradeMsg(); displayGradeMsg(); displayGradeMsg(); return 0; } //------------------------------------- // Instructions. void instructions() { cout << "This program prints an appropriate transcript " << "message for any grade-point" << endl; cout << "average between 0.0 and 4.0. " << "Each time you are prompted to enter a GPA," << endl; cout << "type a value between 0.0 and 4.0 " << "and then hit the <Enter> key." << endl << endl; } // End instructions. // Message determinants. void displayGradeMsg() { int gpa1; cout << "Please enter a grade-point average: "; cin >> gpa1; cout << endl; if (gpa1 >= 3.5) cout << "Highest honors for semester." << endl; else if ((gpa1 >= 3.0) && (gpa1 < 3.5)) cout << "Dean's list for semester." << endl; else if ((gpa1 >= 2.0) && (gpa1 < 3.0)) cout << endl; else if ((gpa1 >= 1.0) && (gpa1 < 2.0)) cout << "On probation for next semester." << endl; else ((gpa1 >= 0.0) && (gpa1 < 1.0)); cout << "Failed semester--registration suspended." << endl; return; } // End message determinants.