-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConditionalStatement.java
More file actions
57 lines (55 loc) · 1.44 KB
/
Copy pathConditionalStatement.java
File metadata and controls
57 lines (55 loc) · 1.44 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
public class ConditionalStatement
{
public static void main(String[] args)
{
int age = 99;
if(age>=18 && age<=60)
{
if(age>=20 && age<30)
{
System.out.println("you are in your 20's");
}
else if(age>=30 && age<40)
{
System.out.println("You are in your 30's");
}
else if(age>=40 && age<50)
{
System.out.println("You are in your 40's");
}
else if(age>=50 && age<60)
{
System.out.println("you are in your 50's");
}
else if(age==60)
{
System.out.println("You are 60 year old");
}
else
{
System.out.println("You have just became adult");
}
}
else if (age<=18)
{
if (age>=13 && age<=17)
{
System.out.println("You are in your teenage");
}
if (age==12 && age>=5)
{
System.out.println("You are a kid");
}
else if(age==4 && age<=1)
{
System.out.println("You are Infant");
}
else
{
System.out.println("you are not born yet");
}
}
else
System.out.println("You are an senior citizen");
}
}