1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#include <iostream>
int main()
{
char grades[] = { 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', //0-9
'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', //10-19
'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', //20-29
'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', //30-39
'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', //40-49
'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', 'F', //50-59
'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', //60-69
'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', //70-79
'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', //80-89
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', //90-99
'A' }; //100
int grade = 89;
std::cout << "Student average: " << grade << "\t\tLetter Grade: " << grades[grade] << std::endl;
return 0;
}
|