i need help with this assignment assignment 3 the function printGrade in example 5-10 is written as a void function to compute and output the course grade the course score is passed as a parameter to the function printGrade rewrite the function printGrade as a returning function so that it computes and returns the course grade. (the course grade must be output in the function main.) also change the name of the function to calculateGrade.
here is the 5-10 example
http://books.google.com/books?id=4Fn_P7tdOZgC&pg=PA279&lpg=PA279&dq=introduction+to+c%2B%2B+example+5-10+ds+malik&source=bl&ots=gTtNYGmwtL&sig=Ntfld3AQqE-AMlf_yY8KPTw0nCU&hl=en&sa=X&ei=QXGUT8fPFYPN6QH_4K25BA&ved=0CCIQ6AEwAA#v=onepage&q&f=false
here is what i have so far i dont want someone to do the assignment for me but just offer help
#include <iostream>
using namespace std;
void getScore(int& score);
char calculateGrade(char ch);
char grade;
int main()
{
int courseScore;
cout << "Based on the course score, \n"
<< " this program computes the "
<< "course grade. " << endl;
getScore (courseScore);
calculateGrade (courseScore);
return 0;
}
void getScore (int& score)
{
cout << "Enter course score: ";
cin >> score;
cout << endl << "Course score is "
<< score << endl;
}
calculateGrade (int cScore)
{ // here is my error ISO C++ forbids declaration of 'calculateGrade' with no type in function int calculateGrade(int) invalid conversion from const char* to char
if (cScore >= 90)
grade = "A";
else if (cScore >= 80)
grade = "B";
else if (cScore >= 70)
grade = "C";
else if (cScore >= 60)
grade = "D";
else grade = "F";
return grade;
}