Question
C++ ONLY EXERCISE ONE: Consider a Date class that stores a calendar date such as November 20, 2011. Consider two possible implementations of this class:
C++ ONLY
EXERCISE ONE: Consider a Date class that stores a calendar date such as November 20, 2011. Consider two possible implementations of this class: one storing the day, month, and year, and another 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?
EXERCISE TWO: Write a partial C++ class definition that contains the public interface of the Date class described in EXERCISE ONE. 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 attention to const.
C++ ONLY
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