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

bookChallenge: Defining and Using Enums

Aufgabe

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.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

Awesome!

Completion rate improved to 8.33

bookChallenge: Defining and Using Enums

Swipe um das Menü anzuzeigen

Aufgabe

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

some-alt