Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you please help with this question using C++ language 1. Complete the implementation of the class time24 as declared in the program time24.h. Do

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

1. Complete the implementation of the class time24 as declared in the program time24.h. Do not modify the main program. You must write the four methods of the class and the two functions write() and add(). Declaration of Class Time 24 File: time 24.h the class time 24 represents time on 24 hour clock times are written to a stream in the form hour: minute when two times are added the minutes are added and if the sum is 60 or more then 60 is subtracted from the sum but the the hour is increas 1. If the hour is 24 or more then 24 is subtracted from the hour. */ #ifndef TIME24-H #define TIME24.H #include using namespace std; class time24 {. private : int hour; int minute ; // hour between 0 and 23 // minute between 0 and 59 public: int gethour (void) const; int get minute (void) const; void set hour (int h); void set minute (int m): // return hour return minute hour = h minute = m void write (ostream & out,const time 24 & x); time 24 add (const time24 & x, const time 24 & y); // prints hour:minute // add u and y #endif / TIME 24-H1 +/ Implementation of Class Time24 /* File: time 24.cpp Implementation of class time 24 */ #include "time24.h" IIIIIIIIIIIIIIIIIIIII/ Methods of time 24 /////// ///////// // |||||||||||||||||||||/ time 24 functions ///// ////// Main Program Using Class Time24 File: testtime24.cpp Application program using class time 24 Programmer: your name Date: #include "time24.h" int main(void) // test the class time24 x, y, z; x. set hour (18); x. set minute (34); y.set hour (10); y.set minute (56); cout using namespace std; class time24 {. private : int hour; int minute ; // hour between 0 and 23 // minute between 0 and 59 public: int gethour (void) const; int get minute (void) const; void set hour (int h); void set minute (int m): // return hour return minute hour = h minute = m void write (ostream & out,const time 24 & x); time 24 add (const time24 & x, const time 24 & y); // prints hour:minute // add u and y #endif / TIME 24-H1 +/ Implementation of Class Time24 /* File: time 24.cpp Implementation of class time 24 */ #include "time24.h" IIIIIIIIIIIIIIIIIIIII/ Methods of time 24 /////// ///////// // |||||||||||||||||||||/ time 24 functions ///// ////// Main Program Using Class Time24 File: testtime24.cpp Application program using class time 24 Programmer: your name Date: #include "time24.h" int main(void) // test the class time24 x, y, z; x. set hour (18); x. set minute (34); y.set hour (10); y.set minute (56); 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

Step: 3

blur-text-image

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

Describe womens potential anti-rape defenses.

Answered: 1 week ago