-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLamp Troubleshooting
29 lines (29 loc) · 994 Bytes
/
Lamp Troubleshooting
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
import java.util.*;
public class Lamp
{
public static void main(String[] args){
System.out.println("Does the lamp work? Yes or No?");
Scanner input = new Scanner(System.in);
String answer = input.nextLine();
if (!answer.equalsIgnoreCase("yes")){
System.out.println("Is the lamp plugged in?");
answer = input.nextLine();
if (!answer.equalsIgnoreCase("yes")){
System.out.println("Plug in your lamp.");
}
else{
System.out.println("Is the bulb burned out?");
answer = input.nextLine();
if (!answer.equalsIgnoreCase("no")){
System.out.println("Please replace the bulb.");
}
else{
System.out.println("Please get your lamp repaired.");
}
}
}
else{
System.out.println("Your lamp isn't broken!");
}
}
}