Question: Question Goal: Learn how to declare and instantiate objects using class constructors. Assignment: Below you have a Timer class defined. Instantiate a Timer object called
Question
Goal: Learn how to declare and instantiate objects using class constructors.
Assignment: Below you have a Timer class defined.
Instantiate a Timer object called timer with the countdownTime data field equal to ;
Instantiate a Timer object called timer with the countdowntime data field equal to ;
Instantiate a Timer object called timer with the countdowntime data field equal to its default value.
class Timer
public:
int countdownTime;
Timer
countdownTime;
Timerint value
countdownTime value;
void tick
if countdownTime
countdownTime;
;
My current code:
Timertimer;
Timertimer;
Timertimer;
Note: my code is compiling correctly and getting the correct output. For some reason I am getting an error about assignment requirements where I have a missing newline at the end of the file.
I am also having this issue and tried doing the solution of adding a newline but it doesn't work at all. Wanted to get a second opinion from someone else. Please help.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
