Professional Documents
Culture Documents
Preparations
In this assignment you design and implement a program that computes the dates of a number
of Christian holy days that depend on the date of Easter. It is not allowed to use the java JRE date
manipulating classes like Calendar, Date etc!
• On Brightspace you find a project easter.zip that already contains the signatures of the
functions that you need to develop. Import this file with IntelliJ.
It returns true only if the argument year is a leap year, and it returns false otherwise.
• Design and implement the parameterized function numberOfDaysInMonth that has the
signature:
Note that the data type Month is already defined as an enumeration type in your project.
1
Part 4.2: Holy days based on Easter
The dates of several Christian holy days depend on Easter in the following way:
• Design and implement the function dayNumberInYear that computes what the day num-
ber is of a given date (day/month/year) in that year. The signature is:
For instance, the number of the first of January is always 1, and the number of the first of
March in a leap year is 61, and it is 60 in non-leap years.
• Design and implement the functions monthInYearOfDayNumber and
dayInMonthOfDayNumber that compute for a given day number in a given year the cor-
responding month, and day in month. The signatures are:
2
For instance, the month of day number 60 in a leap year is February, whereas the month of
day number 60 in a non-leap year is March. Consequently, the day in month of day number
60 in a leap year is 29 (February), and it is 1 (March) in a non-leap year.
• Design and implement the function showHolyDays, using the above created functions.
The signature of this function is: