Friday, July 31, 2009

Calculating letter grade using function in c++?

I am supposed calculate the letter grade using fuction in c++ and I just need some help with writing the actual function. so far, I got this





#include %26lt;iostream.h%26gt;





char getLetterGrade (int gradeIn) {


// replace this comment with your code for this function


} // letterGrade





// insert your code for the getNumericGrade function here








int main() {


int grade;


char letterGrade;





do {


grade = getNumericGrade();


if (grade != -1) {


letterGrade = getLetterGrade(grade);


cout %26lt;%26lt; "The student's letter grade is: " %26lt;%26lt; letterGrade %26lt;%26lt; endl;


}


} while (grade != -1);





cout %26lt;%26lt; "Good-bye" %26lt;%26lt; endl;


return 0;


} // main





can anyone give me any pointers of how to write this function?





Thank you

Calculating letter grade using function in c++?
if grade%26gt;0 and grade%26lt;60 return f





if grade%26gt;59 and grade%26lt;70 return d





etc.


No comments:

Post a Comment