Challenge: else Keyword
Task
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
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 8
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in simpler terms?
What are some examples related to this topic?
Where can I learn more about this?
Awesome!
Completion rate improved to 1.67
Challenge: else Keyword
Swipe to show menu
Task
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
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 8
single