I think you want the output to be:
either
PASSING
(WITH HONORS or WITH HIGH HONORS or WITH HIGHEST HONORS)
or
FAILURE (for when grade is lower than 75)
or
INVALID
Now pay attention to the branching
. You have total 3 main branch here.
1 is when the grade is above 75
2 is when the grade is below 75
3 is when the grade is either less than 0 or greater than 100
each of these branches
define 1 if case
.
The branch 1
can further be broken down like this:
if grade >= 75 PASSING
if grade >= 98 WITH HIGHEST HONORS
else if grade >= 95 WITH HIGH HONORS
else if grade >= 90 WITH HONORS
This should be how you structure the if-else
block.
Also a note about goto
, it's a bad practice, generally you can achieve the same results using a loop with break
statement
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…