Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you please help with this question using C++ language 2. Complete the implementation of another version of the class time24 as declared in the

image text in transcribedimage text in transcribedCould you please help with this question using C++ language

2. Complete the implementation of another version of the class time24 as declared in the program time 24methods.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: time 24 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 TIME 2 METHODS II #define TIME24METHODS H #include using namespace std; class time 24 { private : int hour; int minute: // hour between 0 and 23 // minute between 0 and 59 public: time24 (int h = 0, int m = 0) void write (ostream& out): // prints hour: minute to out time 24 add (const time 24 & y) const; // add y to current time #endif /* TIME METHODS.H */ Implementation of Class Time24 /* File: time 24 methods.cpp Implementation of class time 24 methods */ m m #include "time 24 methods.h" MMMMM 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 "time24methods.h" int main(void) // test the class time24 x(18, 34), y(10,56), 2; cout

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions

Question

Describe how language reflects, builds on, and determines context?

Answered: 1 week ago