Get startedGet started for free

Grade some more

People were so pleased with the custom messages that the authorities now want you to go further in your system. There is a system of mentions in the school, by levels of 2 points starting from 10. You were asked to make sure that students failing were caught early in your code.

This exercise is part of the course

Intermediate Java

View Course

Exercise instructions

  • Catch failing grades, lower than 10, early.
  • Fill in the correct keyword(s) to catch grades lower than 18.
  • Make sure all other grades receive "With highest distinction".

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

class Grader {
    public static void main(String[] args) {
        int grade = 14;

        // Catch failing grades lower than 10
        if (grade < 10) {
            System.out.println("Failing grade");
        } else if (grade < 14) {
            System.out.println("Passing grade");
        // Fill in the correct keyword    
        } ____ ____ (____ ____ ____) {
            System.out.println("With distinction");
        // Fill in the correct keyword    
        } ____ {
            System.out.println("With highest distinction");
        }
    }
}
Edit and Run Code