LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Intermediate Java

Kurs anzeigen

Anleitung zur Übung

  • 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".

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

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    
        } ____ ____ (grade ____ ____) {
            System.out.println("With distinction");
        // Fill in the correct keyword    
        } ____ {
            System.out.println("With highest distinction");
        }
    }
}
Code bearbeiten und ausführen