Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 setYearint y sets the instance variable year to the input parameter y
public void setMonthAndDayint 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started