Question: In C++ language please 2. Complete the implementation of another version of the class time24 as declared in the program time24methods.h. This version uses a

 In C++ language please 2. Complete the implementation of another versionof the class time24 as declared in the program time24methods.h. This version

In C++ language please

2. Complete the implementation of another version of the class time24 as declared in the program time24methods.h. This version uses a constructor. In addition, the two functions write() and add become members of the class rather than functions external to the class. Do not modify the main program. You must write the three methods of the class. Declaration of Class Time24Methods /* File: time24 methods.h the class time 24 represents time on 24 hour clock times are written to a stream in the form hour: minute when a time is added to the current time the minutes are added and if the sum is 60 or more then 60 is subtracted from the sum but the the hour is increased by 1. If the hour is 24 or more then 24 is subtrated from the hour. */ #ifndef TIME24METHODSH #define TIME24METHODS.H #include using namespace std; class time24 { private: int hour : hour between 0 and 23 int minute: 7 minute between 0 and 59 public: time24 int h = 0, int m= 0); constructor with default args void write (ostream & out); prints hour: minute to out time24 add (const time24 & y) const; il add y to current time }; #endif /* TIME METHODS.H */ Implementation of Class Time24 File: time 24 methods.cpp Implementation of class time24methods */ #include "time24methods.h" Mr Methods of time 24 Main Program Using Class Time24Method File: testtime 24 methods.cpp Application program using class time 24 Methods Programmer: your name Date: #include "time 24 methods.h" // test the class int main(void) { time24 x(18, 34), y(10,56), z; cout

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!