Question: class clockType { public: void setTime ( int , int, int ) ; void getTime ( int& , int& , int& ) const; void printTime

class clockType
{
public:
void setTime(int, int, int);
void getTime (int&, int&, int&) const;
void printTime() const;
void incrementSeconds();
void incrementMinutes();
void incrementHours();
bool equalTime (const clockType&) const;
private:
int hr;
int min;
int sec;
};
void clockType::setTime (int hours, int minutes, int seconds)
{
if (0= hours && hours 24)
hr = hours;
else
hr =0;
if (0= minutes && minutes 60)
min = minutes;
else
min =0;
if (0= seconds && seconds 60)
sec = seconds;
else
sec =0;
}
void clockType::getTime(int& hours, int& minutes,
int& seconds) const
{
hours = hr;
minutes = min;
seconds = sec;
}
what is the value of b after executing the following program
clockType myClock;
int a, b, c;
myClock.setTime(3,48,52);
myClock.getTime(a, b, c);
class clockType { public: void setTime ( int ,

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!