Question: C++ Program: // Example 1 // Time class. #include #include using namespace std; class Time { public: Time(); void setTime(int, int, int); void printUniversal(); void

C++ Program:

C++ Program: // Example 1 // Time class. #include #include using namespace

// Example 1

// Time class.

#include

#include

using namespace std;

class Time {

public:

Time();

void setTime(int, int, int);

void printUniversal();

void printStandard();

private:

int hour;

int minute;

int second;

};

Time::Time()

{

hour = 0;

minute = 0;

second = 0;

}

void Time::setTime(int h, int m, int s)

{

hour = (h >= 0 && h

minute = (m >= 0 && m

second = (s >= 0 && s

}

Modify the class Time presented in the class to include a tick member function that increments the time stored in a Time object by one second. The Time object should always remain in a consistent state. Write a program that tests the tick member function. Be sure to test the following cases: incrementing into the next minute; . Incrementing into the next hour; Incrementing into the next day (i.e, 11:59:59 PM to 12:00:00 AM)

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