CJCoding With Joseph
15free / daySign inCreate account

You are parsing and printing workout durations.

Create a class TimeDuration that stores TWO ints: minutes and seconds. - seconds should always be 0..59 (normalize when reading).

Input format for >> : two integers: minutes seconds (e.g., 3 15) Output format for << : M:SS (e.g., 3:15, 0:05)

Requirements: 1) Default constructor sets minutes=0 and seconds=0 2) Overload operator>> to read minutes and seconds and normalize 3) Overload operator<< to print M:SS (SS must be 2 digits)

Do NOT write a main function.

Expected output

3:15
0:05

= newline. The output ends with a newline, so print one after the last line.

Hints4 available
Topics
ClassesOperator Overloading
Auto-input
3 15\n
This input is automatically fed to your program's stdin
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.