Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Switch | Structures de Contrôle
Bases de C#

bookChallenge: Switch

Tâche

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".

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 17
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Switch

Glissez pour afficher le menu

Tâche

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".

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 17
single

single

some-alt