Answer to Question #24386 in C++ for Nour

Question #24386
Write a function that returns A, B, C, D, or F depending on the percentage grade passed to the function. Any grade >= 90 is an A; any grade >= 80 is a B, and so on.
1
Expert's answer
2013-02-15T06:26:01-0500
char getMark(int grade)
{
if(grade >= 90)
return 'A';

else if(grade >= 80)
return 'B';

else if(grade >= 70)
return 'C';

else if(grade >= 60)
return 'D';

else
return 'F';
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS