View Single Post
Old 02-21-2005, 11:55 PM   #1 (permalink)
i like c++
Registered User
 
Join Date: Feb 2005
Posts: 5
i like c++ is on a distinguished road
anyone knows the code for this c++ question?

The Julian calendar consist of a solar year of 12 months and of 365 days withan extra day every four years.

In the Gregorian calendar a year is a leap year if either
1)it is divisible by 4 but not 100 or
2)it is divisible by 100

Using the gregorian calendar, in 1752, (wednesday) september 2 1752 is such that is followed immediately by september 14 1752.

Most computers use the Julian calendar until september 1752, with leap year every four years , then use the Gregorian calendar after that.

1/1/1 falls on a saturday.

Need to construct an ADT for calendar with class "Date" which follow the specifications above.

Need to have the various construtors and functions below:

Date()//initialise to 1/1/1
Date(DD,MM,YYYY)//initialise date to DD/MM/YYYY
next()//To set the date such that it advance the day by 1 day.
printD()//print out day of week(eg.monday, tuesday ,......)
printT()//print out day in the form DD/MM/YYYY.
printW()//print out day in the form such as 12 March 1782.
diffD(D)//print out the absolute number of days between the current date and the and D.

The calendar only work for date from 1/1/1 to 31/12/9999.

Thank you very much!
i like c++ is offline   Reply With Quote