Hi
I am trying to calculate a persons grade, here is my code:
// Purpose: To calculate the grade code awarded for a given mark
// Arguments: mark is used to calculate grade code
// Ret.Val: The grade as a character
// Pre: The mark has been attained
// Post: The grade has been calculated according to relevant
constants
// and returned.
char getGrade(double mark) {
if (mark >=85) printf("High Distinction");
else if (mark >=75) printf("Distinction");
else if (mark >=65) printf("Credit");
else if (mark >=50) prinf ("Pass");
else printf("Fail Grade");
printf("\n");
return 0.0;
}
When I compile the code, I get error message the it forbids comparison
between pointer and integer. I know that you can do via switch
statmen, but am unsure on how to go about it. Could someone direct me
the correct direction.
Thanks in advance.
Greg