Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: else Keyword | Styrstrukturer
C#-Grunder

book Challenge: else Keyword

Uppgift

Swipe to start coding

  • Declare an integer variable age to store the user’s age.
  • Declare a boolean variable isMember to 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 isMember is true, print: Eligible for discount
    • Otherwise, print: Not eligible for discount

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 11
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

close

book Challenge: else Keyword

Svep för att visa menyn

Uppgift

Swipe to start coding

  • Declare an integer variable age to store the user’s age.
  • Declare a boolean variable isMember to 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 isMember is true, print: Eligible for discount
    • Otherwise, print: Not eligible for discount

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 11
single

single

some-alt