ComeçarComece de graça

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.

Este exercício faz parte do curso

Intermediate Java

Ver curso

Instruções do exercício

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

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

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");
        }
    }
}
Editar e executar o código