Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Cat Add member functions previous Second(), next Minutecd, previousminute), next Hour previous Hour to the Time class Time -hour:int = 0 -minute:int = 0

image text in transcribed
image text in transcribed
Using Cat Add member functions previous Second(), next Minutecd, previousminute), next Hour previous Hour to the Time class Time -hour:int = 0 -minute:int = 0 -second:int = 0 +Time(h:int, m:int, s:int) +getHour(): int +getMinute():int +getSecond(): int +setHour(h:int):void +setMinute(m:int):void setSecond(s:int):void +setTime(h:int, m:int, s:int) +print():void +nextSecond():void hh:mm:55 (e.g., 00:01:59) /* Header for the Time class (Time.h) */ #ifndef TIME_H // Include this "block" only if TIME_H is NOT defined #define TIME_H // Upon the first inclusion, define TIME_H so that // this header will not get included more than once class Time private: // private section // private data members int hour; // 0 - 23 int minute; // 0 - 59 int second; 770 - 59 MENSEN public: // public section // public member function prototypes Time (int h = 0, int m= 0, int s = 0); // Constructor with default values int get Hour() const; // public getter for private data member hour void set Hour (int h); // public setter for private data member hour int getMinute() const; // public getter for private data member minute void setMinute (int m); // public setter for private data member minute int getSecond() const; // public getter for private data member second void set Second (int s); // public setter for private data member second void setTime (int , int n, int s); // set hour, minute and second void print() const; // Print a description of this instance in "hh:mm:ss" void nextSecond(); // Increase this instance by one second }; // need to terminate the class declaration with a semicolon #endif // end of "#ifndef" block

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions