Reference no: EM1317342
import java.io.*;
importjava.util.Scanner;
/*******************************************************************************
* Year3000 program
*
* Driver program for the DateInterface and MyDate class.
*
* @authorStudent Name
* @date
* @version 1.0
******************************************************************************/
publicclass Year3000 {
publicstaticvoid main(String[] args) throwsIOException {
logic here...
}
/*******************************************************************************
* userMenu method
*
* This method displays the user menu to the console.
*
* @authorStudent Name
* @date
* @version 1.0
******************************************************************************/
publicstaticvoiduserMenu() {
logic here...
}
}
/**
Interface for Date objects to be used by the Year3000 driver program.
*/
publicinterfaceDateInterface
{
/** @return the day of the month (1-31) */
publicintgetDay();
/** @return the day of the week (0-6) */
publicintgetDow();
/** @return the month of the year (1-12) */
publicintgetMonth();
/** @return the year (four digits) */
publicintgetYear();
/** sets the date
@param m the month of the year (1-12)
@param d the day of the month (1-31)
@param y the year (four digits)
@paramdow the day of the week (0-6) */
publicvoid set(int m, int d, int y, intdow);
/** moves the date forward by exactly one day
@return */
publicvoid tomorrow();
/** @return the date as a String in the format "Monday March 18, 2002" */
public String toString();
/** Moves the date backward by exactly one day. */
publicvoid yesterday();
/** sets the date to today;
make this empty {} unless you do the extra credit. */
publicvoid today();
}
importjava.util.Calendar;
importjava.util.GregorianCalendar;
/*******************************************************************************
* MyDate Class
*
* Description here....
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
*
******************************************************************************/
publicclassMyDateimplementsDateInterface {
declarations here....
publicMyDate() {
}
/*******************************************************************************
* MyDate d
*
* Description here....
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @param d
******************************************************************************/
publicMyDate(MyDate d) {
logic and method calls for date here...
}
/*******************************************************************************
* set method
*
* Description here...
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @paramDateInterface
* @param #set(int, int, int, int)
******************************************************************************/
publicvoid set(int m, int d, int y, intdw) {
variable assignments here...
}
/*******************************************************************************
* tomorrow method
*
* Description here...
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @paramDateInterface
* @returnMyDate
******************************************************************************/
publicvoid tomorrow() {
logic here...
}
/*******************************************************************************
* checkLeapYear method
*
* Description here....
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @returnboolean
******************************************************************************/
publicbooleancheckLeapYear() {
logic here...
}
/*******************************************************************************
* checkDaysInMonth method
*
* Description here....
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @return integer
* @paramlpYr
******************************************************************************/
publicintcheckDaysInMonth(booleanlpYr) {
logic here....
}
/*******************************************************************************
* toString method
*
* Description here....
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @return String
* @param java
* @return formatted dateString
******************************************************************************/
public String toString() {
logic here...
}
/*******************************************************************************
* yesterday method
*
* Description here....
*
* Preconditions:
* Postconditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @return String
* @paramDateInterface
* @returnMyDate
******************************************************************************/
publicvoid yesterday() {
logic here....
}
/*******************************************************************************
* today method
*
* Description here....
*
* Pre-conditions:
* Post-conditions:
*
* @authorStudent Name
* @date
* @version 1.0
* @return void
* @paramDateInterface
* @return month, day, year, dow as integers
******************************************************************************/
publicvoid today() {
logic here...
}
}
Insert UML design diagrams here (use case, class, and sequence diagram).