CJCoding With Joseph
15free / daySign inCreate account

You are tracking distance along a running route.

Create a class Distance that stores meters as an int.

Requirements: 1) Constructor Distance(int meters) 2) int getMeters() const 3) Overload operator- to subtract two Distance values and return a NEW Distance

Do NOT write a main function.

Expected output

250
-10

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

Hints2 available
Topics
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.