Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Name of the class is class time and following that are variables that are public /I default constructor I sets time to O hours, O

Name of the class is class time and following that are variables that are public image text in transcribed
/I default constructor I sets time to O hours, O minutes, o TimeType) / Second TimeTypetint h, int m, int s constructor which sets the time to h hours, m minutes, s seconds // getter functions int getHours) const int getMinutes() const int getSeconds) const // setter function void setTimelint h, int m, int s) // other methods void addSeconds(int k): // adds k seconds to the object time void deductSecondstint k): I/ deducts k seconds from the object time // destructor TimeType) private: int _h; II 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 to o void simplify: . Write the code for private member function simplify). .Write the code for all 8 member methods specified in the class interface, including 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

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

2. To compare the costs of alternative training programs.

Answered: 1 week ago

Question

1. The evaluation results can be used to change the program.

Answered: 1 week ago