Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Operators | Ohjausrakenteet
C# Perusteet

bookChallenge: Operators

Tehtävä

Swipe to start coding

  • Declare an int variable for the user's age.
  • Declare a bool variable 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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 4
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: Operators

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

  • Declare an int variable for the user's age.
  • Declare a bool variable 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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 4
single

single

some-alt