-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSwitch.java
More file actions
35 lines (32 loc) · 1.07 KB
/
Switch.java
File metadata and controls
35 lines (32 loc) · 1.07 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
package Online_Code_Samples.Week2;
import java.util.Scanner;
public class Switch {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter the day of the week");
String inputDay = scanner.next().toLowerCase();
scanner.close();
switch(inputDay){
case "monday":
System.out.println("Today is Monday");
break;
case "tuesday":
System.out.println("Today is Tuesday");
break;
case "wednesday":
System.out.println("Today is Wednesday");
break;
case "thursday":
System.out.println("Today is Thursday");
break;
case "friday":
System.out.println("Today is Friday");
break;
case "saturday":
System.out.println("Today is Saturday");
break;
default:
System.out.printf("Today is %s", inputDay);
}
}
}