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

bookChallenge: Defining and Using Enums

Tehtävä

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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 2
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

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

close

Awesome!

Completion rate improved to 8.33

bookChallenge: Defining and Using Enums

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

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

single

some-alt