Question
Define an ADT class dateType with three data members to store month , day, and year. Some of the operations on the date that you
Define an ADT class dateType with three data members to store month , day, and year. Some of the operations on the date that you need are to set the date and to print the date. The dateType class must contain the following functions to : a. Set date. ( month , day, year ) b. Validate leap year.
For example if the date is 3-21-2000, the function will display : 2000 is a leap year c. Display the date in such that the name of the month is displayed instead of the number. For example, if the date is 3-21-2000 then the function should displayed as March 21, 2000. d. Return the number of days in the month. For example, if the date is 3-21-2000, the number of days to be returned is 31. 3-21-2000 has 31 days. e. Return the number of days passed in the year. For example, if the date is 3-18-2012 , the number of days passed in the year is 77. Note that the number of days returned also includes the current day. Number of days passed in the year is 77 days. f. Return the number of days remaining in the year. For example, if the date is 3-18-2011 and the number of days remaining in the year is 288. Number of days remaining in the year 2011 is 288 days. g. Calculate the new date by adding a fixed number of days to the date. For example, if the date is 3-18-2011 and the number of days to be added are 25, the new date will be 4-12-2011. After Adding 25 days to the current date, the new date will 4-12-2011
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started