Constructor Overloading
mediumQuestion 577The Timer class has a private field seconds. Give it TWO constructors: a parameterless one that starts seconds at 0, and one that takes an int start and uses it. Also add a Tick() method that adds 1 to seconds and a read-only Seconds property. Do NOT write a Main method.
A new Timer() ticked twice prints the output shown in Expected Output.
A new Timer(10) ticked once prints:
11
Expected output
2= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Encapsulation
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cw, cr, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.