Write a class datetype it can perform the following operations on a date , in addition to the operation already defined :
1-set the month
2-set the day
3-set the year
4-return the month
5-return the day
6-return the year
7-test the year is a leap year
8-return the number of days in the month for example if the date is 3-18-2006 the number of days to be returned is 31 because there is 31 days in march
9-return the number of days passed in the year for example if the date is 3-18-2006 the number of days passed in the year is 77.note that the number of days returned also includes the current days.
10-return the number of days remaining in the year for example if the date is 3-18-2006 the number of days remaining in the year is 288.
11-calculate the new date by adding a fixed number of days to the date for example if the date is 3-18-2006 and the days to be added are 25 the new date is 4-12-2006.
einas 0 Newbie Poster
Fbody 682 Posting Maven Featured Poster
einas 0 Newbie Poster
Fbody 682 Posting Maven Featured Poster
einas 0 Newbie Poster
einas 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.