That isn't going to work - as you have probably noticed!
A
char
variable can only hold a single "letter", so things like this:
p='B+';
l='C+';
u='D+';
Will not compile.
Go back a stage, and think again: do this in stages.
Start by getting a grade from the user, and storing it in an appropriate variable - and
int
variables only hold integer values, so they don't work with "59.4", or "88.5". You will have to use a different data type for your grade.
When you have that working (and by that I mean compile it, run it and make sure that when the user enters a value you can read it as a number and print it back out correctly, rejecting any "bad" inputs like "hello") look at working out which "group" the grade falls into. That's not complex, it's just a set of
if...else if...else if...else
statements:
if (grade >= lowestGradeInFirstGroup && grade <= highestGradeInFirstGroup)
{
... In first group
}
else if (grade >= lowestGradeInSecondGroup && grade <= highestGradeInSecondGroup)
{
... in second group
}
...
else
{
... in last group
}
When you have that working (compiling and running ok) look at printing the appropriate grade code and message.
Do it in stages, and it'll be pretty easy!
But ... this is your homework, so the code is all up to you!