Question: Implement an EasterDate class whose objects represent the date of Easter. The EasterDate class should have month, day and year, all integers, as instance variables.

Implement an EasterDate class whose objects represent the date of Easter.
The EasterDate class should have month, day and year, all integers, as instance variables.
The EasterDate class should have the following methods:
public String getMonth()// returns the name of the month as a string (does not return the instance variable
// month)
Note: In the getMonth method, do not use an if statement to get the name of the month.
Instead declare a String array that has the names of the months and use the instance
variable month 1 as the index of this array.
public int getDay()// returns the instance variable day
public int getYear()// returns the instance variable year
public String getWeekDay // Returns the day of the week as a string
public void setYear(int y)// sets the instance variable year to the input parameter y
public void setMonthAndDay(int m, int d)// sets the instance variables month and day to the input
// parameters m and d
public int[] getEasterMonthAndDay()// Calculates the month and day of Easter as integers and returns
// these two integers in an int array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!