Level of Knowledge
Tarea
Swipe to start coding
- Develop a software program that assesses a student's knowledge level by analyzing their score using
switch
statement. - Output in the console:
Low
if the score value is from1
to3
;Intermediate
if the score value is from4
to7
;High
if the score value is from8
to10
.
Solución
solution.cpp
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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?
¡Gracias por tus comentarios!
Sección 2. Capítulo 2
single
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla