Challenge: else Keyword
Tâche
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
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 3. Chapitre 11
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 1.25
Challenge: else Keyword
Glissez pour afficher le menu
Tâche
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
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 3. Chapitre 11
single