public class Dating
{
// Note: this class has no instance variables!
/**
* Creates an empty Dating object so that you can call the methods
*/
public Dating()
{
// Empty constructor
}
/**
* Computes and returns the next year in which New Year's Day will
* fall on the same day of the week as in a given year
* @param theYear the given year
* @return the next year in which New Year's day is the same day
* of the week as in parameter theYear
*/
public int newYears(int theYear)
{
// TO DO: write body of this method here
}
/**
* Computes and returns the Date on which Election Day will fall
* in the USA for a given year.
*
* NOTE: By law, Thanksgiving Day is the first Tuesday after the first
* Monday in November.
*
* @param year the year for which to compute the date of Election Day
* @return the Date of Election Day for the specified year
*/
public Date electionTime(int year)
{
INSERT CODE HERE
}
I feel like I got the electionTime part correct but I am confused as in to where to begin for newYears. Any suggestions? I'm uncertain how to put together a code that would calculate not only when the date is but when it will happen again. I was not given a specific year to start with either.