Challenge: Defining and Using Enums
Tarefa
Swipe to start coding
Practice defining and using an enum to represent status values.
- Define an enum named
Statuswith the valuesPending,InProgress, andDone. - Write a function
isDonethat takes aStatusparameter and returnstrueif the status isDone, otherwise returnsfalse. - Call the
isDonefunction with each possible value ofStatusand print the results using this template: "Status: <status_value>, isDone:" Replace <status_value>with the name of the status, and<result>with eithertrueorfalse.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 2
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Awesome!
Completion rate improved to 8.33
Challenge: Defining and Using Enums
Deslize para mostrar o menu
Tarefa
Swipe to start coding
Practice defining and using an enum to represent status values.
- Define an enum named
Statuswith the valuesPending,InProgress, andDone. - Write a function
isDonethat takes aStatusparameter and returnstrueif the status isDone, otherwise returnsfalse. - Call the
isDonefunction with each possible value ofStatusand print the results using this template: "Status: <status_value>, isDone:" Replace <status_value>with the name of the status, and<result>with eithertrueorfalse.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 2
single