Code:
scanf("%c%c %d", &grade, &suffix, &credits);
A better way would to be to read into a buffer using fgets, and then do something like:
Code:
switch( toupper( buffer[0] ) )
{
case 'A': ... break;
...
case 'F': ... break;
default: message about an invalid grade...
}
if( buf[1] == '+' )
...
else
if( buf[1] == '-' )
...
The next problem you have is here, and this is your main problem:
Code:
while !(grade == SENTINEL && credits == SENTINEL)
This should be, at the very least, done this way:
Code:
while( !(grade == SENTINEL && cretids == SENTINEL) )
You need parenthesis around the true/false statement.
And finally, you can't subtract decimal ammounts from a character. You should be using a double or float and giving that the value.
Code:
double grade = 0.0;
...
case 'A': grade = 4.0; break;
...
if( ...plus suffix... )
grade += 0.33;
Try that on for size and see what you come up with. Oh, and you likely want "#include <stdio.h>" instead of with quotes.
Quzah.