Please send questions to
st10@humboldt.edu .
/*
Contract: describe_grade2: char -> void
Purpose: prints to the screen on its own line
a prose description for the
<grade> expressed as a char.
If an unrecognized grade is given,
prints "Unrecognized Grade"
Examples: describe_grade2('A') prints to the screen:
Excellent
describe_grade2('b') prints to the screen:
Very Good
describe_grade2('C') prints to the screen:
Acceptable
describe_grade2('d') prints to the screen:
Marginal
describe_grade2('F') prints to the screen:
Insufficient
describe_grade2('g') prints to the screen:
Unrecognized Grade
*/
#include <iostream>
#include "describe_grade2.h" // here because named constants
// are declared there
using namespace std;
void describe_grade2 (char grade)
{
switch(grade)
{
case 'a':
case 'A':
cout << A_DESCR << endl;
break;
case 'b':
case 'B':
cout << B_DESCR << endl;
break;
case 'c':
case 'C':
cout << C_DESCR << endl;
break;
case 'd':
case 'D':
cout << D_DESCR << endl;
break;
case 'f':
case 'F':
cout << F_DESCR << endl;
break;
default:
cout << OTHER_DESCR << endl;
}
}