-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_18.java
More file actions
35 lines (35 loc) · 1.01 KB
/
Main_18.java
File metadata and controls
35 lines (35 loc) · 1.01 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
import java.util.Scanner;
public class Main_18 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.println("Enter your age:");
int age=in.nextInt();
if (age>=60){
System.out.println("senior citizen");
}
else if (age<60 && age>30){
System.out.println("working");
}
else if (age<=30 && age>18){
System.out.println("adult");
}
else{
System.out.println("child");
}
System.out.println("Enter your name:");
String name=in.next();
switch(name){
case "riya":
System.out.println("youngest daughter");
break;
case "priya":
System.out.println("elder daughter");
break;
case "subh":
System.out.println("only son");
break;
default:
System.out.println("not our child");
}
}
}