Question: C++ Working with classes (all written below is a single exercise): Define a Date class that contains integer variables for the day, month, and year.

C++

Working with classes (all written below is a single exercise):

Define a Date class that contains integer variables for the day, month, and year. 1.1. Create methods for the class: set, get, default constructor, constructor with arguments.

1.2. Create a method that calculates the number of days between two dates (objects) passed to it.

1.3. Create a dateUpdate method that calculates the next day (assuming there are 30 days in each month)

Define a Time class that contains integer variables for hours and minutes. The Time class inherits the Date members. 2.1. Create methods for the class: set, get, default constructor, constructor with arguments.

2.2. Create a timeUpdate method that calculates time in one minute.

2.3. Create a dateAndTime method that calculates the time in one minute with the date in mind (if at 23:59, one minute will be 00:00 the next day; if the same time is December 31, one minute will be the New Year ).

Write a program implementation demonstrating all methods in both classes. The code should include comments describing the written program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!