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
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