Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Switch | Kontrollstrukturer
C#-Grunnleggende

bookChallenge: Switch

Oppgave

Swipe to start coding

Your task is to complete the PrintPlanDescription method so that it uses a switch statement to print the correct plan or day description based on the numeric code provided by the user.

  • If the code is 1, print "Basic Plan".
  • If the code is 2, print "Standard Plan".
  • If the code is 3, print "Premium Plan".
  • If the code is 4, print "Weekend".
  • If the code is 5, print "Holiday".
  • For any other code, print "Invalid code".

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 17
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Switch

Sveip for å vise menyen

Oppgave

Swipe to start coding

Your task is to complete the PrintPlanDescription method so that it uses a switch statement to print the correct plan or day description based on the numeric code provided by the user.

  • If the code is 1, print "Basic Plan".
  • If the code is 2, print "Standard Plan".
  • If the code is 3, print "Premium Plan".
  • If the code is 4, print "Weekend".
  • If the code is 5, print "Holiday".
  • For any other code, print "Invalid code".

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 17
single

single

some-alt