Challenge: Operators
Opgave
Swipe to start coding
- Declare an
intvariable for the user's age. - Declare a
boolvariable for membership status. - Use comparison operators (
>=) to check if age is 65 or older. - Use logical operators (
||) to check if the user is a member. - Use a ternary operator (
?:) to assign the message"Eligible for discount"or"Not eligible for discount"based on the conditions. - Print the message to the console using
Console.WriteLine.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 3. Kapitel 4
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 1.25
Challenge: Operators
Stryg for at vise menuen
Opgave
Swipe to start coding
- Declare an
intvariable for the user's age. - Declare a
boolvariable for membership status. - Use comparison operators (
>=) to check if age is 65 or older. - Use logical operators (
||) to check if the user is a member. - Use a ternary operator (
?:) to assign the message"Eligible for discount"or"Not eligible for discount"based on the conditions. - Print the message to the console using
Console.WriteLine.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 3. Kapitel 4
single