-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprac.java
More file actions
50 lines (41 loc) · 1.73 KB
/
prac.java
File metadata and controls
50 lines (41 loc) · 1.73 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
import java.util.Scanner;
public class prac {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Do you like dogs?");
String option = sc.next();
if(option.equalsIgnoreCase("Yes")){
System.out.println("what size do you prefer");
String size=sc.next();
if(size.equalsIgnoreCase("small")){
System.out.println("do you live in a cold place");
String cold = sc.next();
if(cold.equalsIgnoreCase("Yes")){
System.out.println("the dog we suggest you is : Shih Tzu");
}
else
System.out.println("the dog we suggest you is:Beagle");
}
else if(size.equalsIgnoreCase("medium")){
System.out.println("do you live in a cold place");
String cold = sc.next();
if(cold.equalsIgnoreCase("Yes")){
System.out.println("the dog we suggest you is :Border Collie");
}
else
System.out.println("the dog we suggest you is:Cocker Spaniel");
}
else if(size.equalsIgnoreCase("large")){
System.out.println("do you live in a cold place");
String cold = sc.next();
if(cold.equalsIgnoreCase("Yes")){
System.out.println("the dog we suggest you is : Siberian Husky");
}
else
System.out.println("the dog we suggest you is:Labrador Retrieve");
}
}
else if(option.equalsIgnoreCase("No"))
System.out.println("No worries! Have a great day.");
}
}