Challenge: else Keyword
Compito
Swipe to start coding
- Declare an integer variable
ageto store the user’s age. - Declare a boolean variable
isMemberto indicate if the user is a member. - Use an if-else statement to check the following conditions:
- If the user is 65 or older or
isMemberis true, print:Eligible for discount - Otherwise, print:
Not eligible for discount
- If the user is 65 or older or
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 11
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Fantastico!
Completion tasso migliorato a 1.25
Challenge: else Keyword
Scorri per mostrare il menu
Compito
Swipe to start coding
- Declare an integer variable
ageto store the user’s age. - Declare a boolean variable
isMemberto indicate if the user is a member. - Use an if-else statement to check the following conditions:
- If the user is 65 or older or
isMemberis true, print:Eligible for discount - Otherwise, print:
Not eligible for discount
- If the user is 65 or older or
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 11
single