Challenge: Defining and Using Enums
Завдання
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.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 2
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Suggested prompts:
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Awesome!
Completion rate improved to 8.33
Challenge: Defining and Using Enums
Свайпніть щоб показати меню
Завдання
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.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 2
single