Why doesn't it work? Ask specific questions or tell us exactly what is going wrong.
You have several possible problems.
1. Where are you extracting that "sentinel" value?
2. Since you're switching between the extraction operator>> and getline you can expect problems caused by the left over newline character.
3. This else if (80 < average <= 90) will not produce the desired effect. You can't combine "tests" like this in C++ you need to use one of the logical operators( &&, ||, etc) and you must have both sides of the comparison (average > 80).
First I don't see where you're extracting that sentinel character. You probably should be using a while() loop to extract the grades instead of the for loop.
Second when switching between the extraction operator>> and getline() you need to be sure the end of line character is properly handled after the extraction operator but before getline(). One quick way is to remove the leading whitespace characters in the getline call: