Building on the previous grade calculator, this exercise teaches a powerful programming pattern: declaring a variable with a default value and conditionally changing it.
Notice how message is set to "passed" by default, since most grades (A, B, C, D) are passing. We only need to change it to "failed" in one place - the else block for F grades!
In the else block, set message to "failed". Then run the code and enter a failing score to see how the message variable is updated to the new value.
Output (Console)