Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment will demonstrate your understanding of the following: 1. CH classes; 2. Implementing a class in CH; 3. Operator overloading with chaining; 4.

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
In this assignment will demonstrate your understanding of the following: 1. CH classes; 2. Implementing a class in CH; 3. Operator overloading with chaining; 4. Preprocessor directives #ifndef, #define, and #endif; 5. this - the pointer to the current object. In this assignment you will implement the Date class and test its functionality. Consider the following class declaration for the class date: class Date public: Date(); //default constructor; sets n-01, 0-01, y-0001 Date(unsigned m, unsigned d, unsigned y); //explicit-value constructor to set date equal to today's //date. Use 2-digits for month (n) and day (d), and 4-digits for year (y); this function should //print a message if a leap year. void display();//output Date object to the screen int getMonth();//accessor to output the month int getDay();//accessor to output the day int getYear();//accessor to output the year void set Month(unsigned );//mutator to change the month void setDay (unsigned d); //mutator to change the day void setYear(unsigned y);//mutation to change the year friend ostream& operator #include sinclude //*** //Nane: set Month //Precondition: //Postcondition: //Description: 1/ void Date::set Month(unsigned ) ( > // //Name: setDay //Precondition: // Postcondition: //Description: 1 11 void Date!! setDay (unsigned d) { ) / /Name: getYear // Precondition: 1/Postcondition: //Description: 11 1/ vold Date::setyear(unsignedy) { } ostres & operator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How are inflation and unemployment related in the short run?

Answered: 1 week ago

Question

b. Explain how you initially felt about the communication.

Answered: 1 week ago

Question

3. Identify the methods used within each of the three approaches.

Answered: 1 week ago

Question

a. When did your ancestors come to the United States?

Answered: 1 week ago