V22.0101 ..... Homework 4 ..... Fall 2006
Calendar Dates

Assigned: Wed Oct 11
Due: Tue Oct 17 at midnight.

Write a program which implements a class Date, as follows. The data fields (instance variables), which are all integers, are:

The methods are: The main method should not be part of class Date. It should be part of class TestDate, your outer class that tests the Date class. In particular, it should test the dayOfWeek method. It should demo a few example dates, by constructing objects such as your birthday and famous dates from history, as well as a few random dates (using the random constructor). It should then prompt the user to enter his/her own test dates, reading them using JOptionPane or Scanner. The valid method should be called to make sure a date is valid before calling the dayOfWeek method. You should print out the day of the week in a nice format, writing out the name, not just printing the integer returned by dayOfWeek. (You could use another method to translate the integer to the name of the day.) A few more comments: