FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaGB/lista_2_java/questao_3.java at main · githubdaestela/JavaGB · GitHub
githubdaestela
/
JavaGB
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
7
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaGB
/
lista_2_java
/
questao_3.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (30 loc) · 796 Bytes
Breadcrumbs
JavaGB
/
lista_2_java
/
questao_3.java
Copy path
File metadata and controls
38 lines (30 loc) · 796 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
29
30
31
32
33
34
35
36
37
38
/*Lista 2 Laço Condicional Java: 3. Faça um programa que receba a idade de uma pessoa e
mostre na saída em qual categoria ela se encontra: 10-14 infantil; 15-17 juvenil; 18-25 adulto*/
package
lista_2_java
;
import
java
.
util
.*;
public
class
questao_3
{
public
static
void
main
(
String
args
[])
{
Scanner
read
=
new
Scanner
(
System
.
in
);
int
idade
;
System
.
out
.
println
(
"Insira sua idade: "
);
idade
=
read
.
nextInt
();
if
(
idade
>=
10
&&
idade
<=
14
)
{
System
.
out
.
println
(
"Você é da categoria Infatil."
);
}
else
if
(
idade
>
14
&&
idade
<=
17
)
{
System
.
out
.
println
(
"Você é da categoria Juvenil."
);
}
else
if
(
idade
>
17
&&
idade
<=
25
)
{
System
.
out
.
println
(
"Você é da categoriaa Adulto."
);
}
else
{
System
.
out
.
println
(
"Insira uma idade válida."
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL