Question: Assignment: Using C + + , Below you have a Timer class defined. Assume a Timer object named timer has been instantiated and that an

Assignment: Using C++, Below you have a Timer class defined. Assume a Timer object named timer has been instantiated and that an integer variable named numOfTicks has been declared and stores an integer value. Write a piece of code that calls the timer object's function tick exactly numOfTicks times.
class Timer
{
public:
int countdownTime;
Timer()
{
countdownTime =60;
}
Timer(int value)
{
countdownTime = value;
}
void tick()
{
if (countdownTime >0)
{
countdownTime--;
}
}
};

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!