Skip to content

Commit 38cf7ae

Browse files
committed
Solutions to Java Introduction section
1 parent 4a21cb4 commit 38cf7ae

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.util.Scanner;
2+
import java.time.LocalDate;
3+
4+
public class Solution {
5+
6+
public static String getDay(String day, String month, String year) {
7+
LocalDate date = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
8+
return date.getDayOfWeek().name();
9+
}
10+
11+
public static void main(String[] args) {
12+
Scanner in = new Scanner(System.in);
13+
String month = in.next();
14+
String day = in.next();
15+
String year = in.next();
16+
17+
System.out.println(getDay(day, month, year));
18+
}
19+
}

0 commit comments

Comments
 (0)