C and C++ do not have "END IF" statements.
int score;
char grade =0;
// read in total score
cout << endl;
cout << "Enter total score (float, must be <= 100): ";
cin >> score;
if (score >= 85);
grade = 'A';
else if (score >= 75);
grade = 'B';
else if (score >= 65);
grade = 'C';
else if (score >= 55);
grade = 'D';
else
grade = 'F';
// display the result
cout << endl;
cout << "Your grade for CMSC 101 is: " << grade << endl;
return (0); // terminate with success
Last edited by Ancient Dragon; Oct 21st, 2008 at 11:53 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,945 posts
since Aug 2005