Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Combining Structs and Enums | Enumerations in C++
Quizzes & Challenges
Quizzes
Challenges
/
C++ Structures and Enumerations

bookChallenge: Combining Structs and Enums

Tarea

Swipe to start coding

Define a struct named Student that contains an enum Level with the values Freshman, Sophomore, Junior, Senior and a member variable level of type Level. Write a function named isSenior that takes a Student object as a parameter and returns true if the student's level is Senior, otherwise returns false. In the main function, create a Student with the level set to Senior and another with the level set to Junior. Print the result of calling isSenior for both students using the format: "Is the student a senior? {result}", where {result} is true or false.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 4
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

Awesome!

Completion rate improved to 8.33

bookChallenge: Combining Structs and Enums

Desliza para mostrar el menú

Tarea

Swipe to start coding

Define a struct named Student that contains an enum Level with the values Freshman, Sophomore, Junior, Senior and a member variable level of type Level. Write a function named isSenior that takes a Student object as a parameter and returns true if the student's level is Senior, otherwise returns false. In the main function, create a Student with the level set to Senior and another with the level set to Junior. Print the result of calling isSenior for both students using the format: "Is the student a senior? {result}", where {result} is true or false.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 4
single

single

some-alt