Avsnitt 1. Kapitel 27
single
Challenge: Operators
Svep för att visa menyn
Uppgift
Svep för att börja koda
- 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 allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 27
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