/* This program reads a test score, calculates the letter
grade for the score, and prints the grade.
*/
#include <iostream>
using namespace std;
char studentScore (int score);
int main ()
{
cout << "Enter the test score (0-100): ";
int score;
cin >> score;
char grade = studentScore (grade);
cout << "The grade is: " << grade << endl;
cout << "\n\n\n";
system("pause");
return 0;
}
/* ===================== studentScore =====================
This function calculates the letter grade for a score.
Pre the parameter score
Post Returns the grade
*/
char studentScore (int score)
{
int temp = score / 100;
char grade;
switch (temp)
{
case 100 : grade = 'A Plus!';
break;
case 90 : grade = 'A';
break;
case 80 : grade = 'B';
break;
case 70 : grade = 'C';
break;
case 60 : grade = 'D';
break;
default : grade = 'F';
} // switch
return grade;
}
WHAT AM I DOING WRONG HERE???