/** * A class to give students experience using loops. This class * creates and manipulates objects of Greg's Date class. */ public class SpeedDating { // Note: this class has no instance variables! /** * Create an empty SpeedDating object * (this is known as a "default" constructor) */ public SpeedDating() {} // Constructor has empty body /** * Prints the day of the week (e.g. "Thursday") on which Valentine's * day will fall for 10 consecutive years * * Note: Valentine's Day is February 14th * * @param startYear the first of the 10 consecutive years */ public void beMyValentine(int startYear) { // TO DO: write body of this method here } /** * Computes and returns the Date on which Columbus Day will fall * in a given year. * * NOTE: By law, Columbus Day is the second Monday in October * * @param year the year for which to compute the date of Columbus Day * @return the date of Columbus Day for the specified year */ public Date discoverColumbusDay(int year) { // TO DO: write body of this method here } /** * Returns the date that lies midway between two dates. * * Precondition: The start date must occur on or before the end date. * * @param start the earlier of the two dates * @param end the later of the two dates * * @return the Date halfway between the start date and the end date */ public Date getHalfWayDate(Date start, Date end) { // NOTE: Do NOT modify the parameters "start" or "end" in this method! // Doing so will modify the arguments in the calling method. // Instead, use one (or both) of the copies created below: Date d1 = new Date(start.getMonth(), start.getDay(), start.getYear()) ; Date d2 = new Date(end.getMonth(), end.getDay(), end.getYear()) ; // TO DO: write remainder of body of this method here } }