Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

II default constructor // sets time to 0 hours, 0 minutes, 0 seconds TimeType() /I Second constructor which sets the time to h hours, m

image text in transcribedimage text in transcribed

II default constructor // sets time to 0 hours, 0 minutes, 0 seconds TimeType() /I Second constructor which sets the time to h hours, m minutes, s seconds TimeTypelint h, int m, int s); // getter functions int getHours() const; int getMinutes() const; int getSeconds() const; // setter function void setTime(int h, int m, int s); // other methods void addseconds(int k); // adds k seconds to the object time void deductseconds(int k); // deducts k seconds from the object time // destructor TimeTypel) private: int _h; //holds hours int _m;// holds minutes int s;// holds seconds // This function checks for the values in _m and _s greater than 59 or // less than 0. If such values are found, the numbers stored are adjusted // to reflect a standard notation of a time duration. Examples: // 0 hours, 12 minutes, 61 seconds would be adjusted to 0 hours, 13 minutes, 1 second // 0 hours, 60 minutes, 61 seconds would be adjusted to 1 hour, 1 minute, 1 second //0 hours, 2 minutes, -2 seconds would be adjusted to 0 hours, 1 minutes, 58 seconds // Overall time must be positive. If it is negative, _h, _m, _s should be reset toO void simplify(); . Write the code for private member function simplify). . Write the code for alil 8 member methods specified in the class interface, incltuding the constructors

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago