Avsnitt 1. Kapitel 32
single
Challenge: else Keyword
Svep för att visa menyn
Uppgift
Svep för att börja koda
- 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
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 32
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal