Simple If Conditions

In programming we often check particular conditions and perform various actions depending on the result of the check. This is done by if condition, which has the following structure:

if (condition)
    // condition body;  

Example: Excellent Grade

We read the grade from the console and check if it's excellent (≥ 5.50).

Test the code from the example locally. Try entering different grades, for example 4.75, 5.49, 5.50 and 6.00. For grades less than 5.50, the program will not give any output, however if the grade is 5.50 or greater, the output would be "Excellent!".

Testing in the Judge System

Test your solution from the example here:

results matching ""

    No results matching ""