IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Intermediate Java

Visualizza il corso

Istruzioni dell'esercizio

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

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

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");
        }
    }
}
Modifica ed esegui il codice