-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEaster.java
More file actions
73 lines (61 loc) · 1.37 KB
/
Copy pathEaster.java
File metadata and controls
73 lines (61 loc) · 1.37 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package nl.ru.ai.easter;
import java.util.Scanner;
public class Easter {
static boolean isLeapYear(int year) {
if (year % 100 == 0) {
if (year % 400 == 0) {
return true;
}
} else {
if (year % 4 == 0) {
return true;
}
}
return false;
}
static int numberOfDaysInMonth(int year, Month month) {
if(month == Month.FEBRUARY){
if(isLeapYear(year)){
return 29;
}else{
return 28;
}
}
switch(month){
case APRIL:
case JUNE:
case SEPTEMBER:
case NOVEMBER:
return 30;
default:
return 31;
}
}
static Month easterMonth(int year) {
// implement this function
return Month.JANUARY;
}
static int easterDay(int year) {
// implement this function
return 0;
}
static int dayNumberInYear(int day, Month month, int year) {
// implement this function
return 0;
}
static Month monthInYearOfDayNumber(int dayNumber, int year) {
// implement this function
return Month.JANUARY;
}
static int dayInMonthOfDayNumber(int dayNumber, int year) {
// implement this function
return 0;
}
static void showHolyDays(int year) {
// implement this function
}
public static void main(String[] arguments) {
isLeapYear(2021);
System.out.println(numberOfDaysInMonth(2021, Month.JANUARY));
}
}