Determine the day of the week for New year\'s day in the year 3000. To do this y
ID: 3528860 • Letter: D
Question
Determine the day of the week for New year's day in the year 3000. To do this you must create your own date class (MyDate) and use the following interface and main program. /** Driver class for the dating programming */ public class Year3000 { public static void main(String [] args) throws IOException { DateInterface d = new MyDate(); d.set(1,29,2006,0); sets the date to Sunday, January 29th, 2006 while(d.getYear() ** Interface for Date Objects to be used by the Year3000 driver Program. @author * public interface MyDate { ** @return the day of the month (1-31) * public int getDay(); ** @return the day of the week (0-6) * public int getDow(); ** @return the month of the year (1-12) * public int getMonth(); ** @return the year (four digits) * public int getYear(); ** sets the date @param m the month of the year (1-12) @param d the day of the mongth (1-31) @param y the year (four digits) @param dow the day of the week (0-6) * public void set(int m, int d, int y, int dow); ** moves the date forward by exactly one day * public void tomorrow(); ** @return the date as a String in the format "Monday March 18, 2002" * public String toString(); ** sets the date to today; make this empty {} unless you do the extra credit. * public void today(); ** Moves the date backword by exactly one day; make this empty {} unless you do the extra credit. * public void yesterday(); } When the program is compiled and run, it should use your MyDate to correctly predict the day of the week for January 1st, 3000. Note theat we are using integers 0-6 for the days of the week, with 0 representing sunday, 1 for Monday etc. Implement a yesterday() function which moves the date one dye backwards. modify your main to print the date, including the day of the week for January 1st, 1800Explanation / Answer
import java.io.*; /** Driver class for The Dating Game programming assignment. @author */ public class Year3000 { public static void main(String [] args) throws IOException { DateInterface d = new MyDate(); d.set(1,29,2006,0); // sets the date to Sunday, January 29th, 2006 while(d.getYear()Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.