Question
Write a partial C++ class definition that contains the public interface of the Date class described in Exercise R9.2. Supply member functions for setting the
Write a partial C++ class definition that contains the public interface of the Date class described in Exercise R9.2. Supply member functions for setting the date to a particular year, month, and day, for advancing the date by a given number of days, and for finding the number of days between this date and another. Pay atten tion to const.
Exercise R9.2
Consider a Date class that stores a calendar date such as November 20, 2011. Consider two possible implementations of this class: by storing the day, month, and year, and by storing the number of days since January 1, 1900. Why might an implementor prefer the second version? How does the choice affect the user of the class?
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