CS1120 Spring 2007
Instructor: Zille Huma Kamal
January 9, 2007
Develop a class called Date with the following members
- private data members: day, month, year
- properties for each private data member
- A print method that prints the date in traditional
- A print method that prints the date in the
following format Today is 6th day of September in the year
- A set date method, which takes 3 arguments, day,
month and year and assigns them to the data members
- 2 constructors:
default constructor that sets the date to October 1 1979
overloaded constructor that takes 3 arguments, and assigns them to the day,
month and year data members
Develop a class called TestDate which does the following:
- Create three Date
objects, and initialize them as follows:
- Default date object
- A date object with the following date: 04/29/04
- And a data object with the following date: June 18th 2006
- Print the objects
- Ask the user for a date, and create a new date object
that represents the user given date.
- Print the date object of (6).
- Open the test
file, read the Dates
and store them in a Date array.
File Format mm/dd/yyyy.
- Sort the entries in the array in ascending order and