Can someone tell me why my function is not working?
Yes, well no. You don't need to pass grade in. It'd be more like:
1 2 3 4 5 6 7 8 9 10 11 12
|
char getGrade(double totalNumGrade)
{
char grade;
if (totalNumGrade >= 90.0) grade = "A";
else if (totalNumGrade >= 80.0) grade = "B";
else if (totalNumGrade >= 70.0) grade = "C";
else if (totalNumGrade >= 60.0) grade = "D";
else grade = "F";
return grade;
}
|
Last edited on
Topic archived. No new replies allowed.