Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Level of Knowledge | Conditional Control Flow Practice
C++ Conditional Statements

book
Level of Knowledge

Tarea

Swipe to start coding

  1. Develop a software program that assesses a student's knowledge level by analyzing their score using switch statement.
  2. Output in the console:
    • Low if the score value is from 1 to 3;
    • Intermediate if the score value is from 4 to 7;
    • High if the score value is from 8 to 10.

Solución

solution.cpp

solution.cpp

#include <iostream>

int main()
{
int score = 8;
switch (score)
{
case 1:
case 2:
case 3:
std::cout << "Low" << std::endl;
break;
case 4:
case 5:
case 6:
case 7:
std::cout << "Intermediate" << std::endl;
break;
case 8:
case 9:
case 10:
std::cout << "High" << std::endl;
break;
}
}

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 2
single

single

#include <iostream>

int main()
{
int score = 8;
switch (score)
{
case 1:
case 2:
case 3:
std::cout << "___" << std::endl;
break;
case 4:
___:
___:
case 7:
std::cout << "Intermediate" << std::endl;
___;
___:
___:
___:
std::cout << "___" << std::endl;
___;
}
}

Pregunte a AI

expand

Pregunte a AI

ChatGPT

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

some-alt