-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDayToNumberOfWeek.java
More file actions
34 lines (34 loc) · 1.01 KB
/
Copy pathDayToNumberOfWeek.java
File metadata and controls
34 lines (34 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
import java.util.Scanner;
public class DayToNumberOfWeek {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter the Day");
String day = in.nextLine();
switch (day.toLowerCase()) {
case "sunday":
System.out.println("1");
break;
case "monday":
System.out.println(2);
break;
case "tuesday":
System.out.println(3);
break;
case "wednesday":
System.out.println(4);
break;
case "thursday":
System.out.println(5);
break;
case "friday":
System.out.println(6);
break;
case "saturday":
System.out.println(7);
break;
default:
System.out.println("Invalid ");
}
in.close();
}
}