Question: Overload the a) ostream & operator(ostream> Output the human-readable time to the output stream out. b) string to_string(clock_time c) Return the human-readable time as a

Overload the

a)

ostream & operator(ostream>

Output the human-readable time to the output stream out.

b)

string to_string(clock_time c)

Return the human-readable time as a string.

The class clock_time returns hours, minutes and seconds (e.g h=12 ,m=50,s=30).The human-readable representation/string representation of a clock_time object is the time as it would appear on a 24-hour clock. That is, it would appear as h:mm:ss, where h is the natural representation of the hour (not padded), while mm is the minutes past the hour,left padded with zeroes if necessary to ensure it has two digits, and ss is similarly the number of seconds past the minute, left padded with zeroes. Use setw() and setfill() stream manipulators; the to_string function then can be written using an ostringstream obj

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 Programming Questions!