class Date { // DECLARE YOUR FIELDS HERE /** Getter for year. * @return this Date's year. */ int getYear() { return this.year; } /** Setter for the year field. * @param _year The year to set this Date's year to (A.D.). */ void setYear( int _year ) { this.year = _year; } /** Getter for month. * @return this Date's month. */ // WRITE YOUR GETTER HERE /** Setter for the month field. * @param _month The month to set this Date's month to (1..12). */ // WRITE YOUR SETTER HERE /** Getter for day. * @return this Date's day. */ int getDay() { return this.day; } /** Setter for the day field. * @param _day The day to set this Date's day to (1..31). */ void setDay( int _day ) { this.day = _day; } /** Date constructor. * @param _year The year (in A.D.) * @param _month a number in 1..12. * @param _day The day-of-month (a number in 1..31) */ // WRITE THE CONSTRUCTOR HERE /** Return a String representing this date in the US format * (that is, month/day/year). Includes leading zeroes. * @return a String representing this date in the ISO format */ String toStringUS() { return "REPLACE this stub with your code"; } /** Return a String representing this date in the european format * (that is, day-month-year). Includes leading zeroes. * @return a String representing this date in the ISO format */ String toStringEuro() { return "REPLACE this stub with your code"; } /** Return a String representing this date in the ISO format * (that is, year.month.day). Includes leading zeroes. * @return a String representing this date in the ISO format */ String toStringISO() { return "REPLACE this stub with your code"; } /** Convert an int into a String, padded as necessary with a leading "0" * so that it is at least 2 characters long. * @param n The number to convert to a (padded) String. * @return A string of length at least 2, representing n. */ String intToStringPad2( int n ) { String nStr = (new Integer(n)).toString(); if ((0 <= n) && (n < 10)) { return "0" + nStr; } else { return nStr; } } }