Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Defining and Using Enums | Enumerations in C++
C++ Structures and Enumerations

bookChallenge: Defining and Using Enums

Tâche

Swipe to start coding

Practice defining and using an enum to represent status values.

  • Define an enum named Status with the values Pending, InProgress, and Done.
  • Write a function isDone that takes a Status parameter and returns true if the status is Done, otherwise returns false.
  • Call the isDone function with each possible value of Status and print the results using this template: "Status: <status_value>, isDone: " Replace <status_value> with the name of the status, and <result> with either true or false.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
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

Awesome!

Completion rate improved to 8.33

bookChallenge: Defining and Using Enums

Glissez pour afficher le menu

Tâche

Swipe to start coding

Practice defining and using an enum to represent status values.

  • Define an enum named Status with the values Pending, InProgress, and Done.
  • Write a function isDone that takes a Status parameter and returns true if the status is Done, otherwise returns false.
  • Call the isDone function with each possible value of Status and print the results using this template: "Status: <status_value>, isDone: " Replace <status_value> with the name of the status, and <result> with either true or false.

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 2
single

single

some-alt