Question: Given the following class (i.e. Time), define a new class TimeOfDay that *inherits* from it and adds the following information: day of the month (int),

Given the following class (i.e. Time), define a new class TimeOfDay that *inherits* from it and adds the following information: day of the month (int), month of the year (int), year(int).

class Time {

public:

Time(int hh, int mm, int ss) : h(hh), m(mm), s(ss) {}

private

int h, m, s;

}

In your definition include the following prototypes but not the implementations (those are asked for later):

Reminder a definition of a class is what you usually include in the header file (i.e. .h, .hpp)

*Implement* : (Reminder: definition is what you usually include in the .cc or .cpp file) 0.-Default constructor. 1.-Constructor that takes hour, minute, second, day of the month, month of the year, and year as parameters

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!