Scale a Duration (operator*)
easyQuestion 72You are scaling workout durations.
Create a class Duration that stores seconds as an int.
Requirements:
1) Constructor Duration(int seconds)
2) int getSeconds() const
3) Overload operator* to allow: Duration newDur = dur * factor;
(factor is an int)
Do NOT write a main function.
Expected output
180 0
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
ClassesOperator Overloading
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.