CJCoding With Joseph

Interface Method Returning a Formatted String

The IMovable interface declares string Move(int distance). Complete the Car class so Move returns the text Moved N meters, where N is the distance passed in. Do NOT write a Main method.

For Move(10) the program prints:
Moved 10 meters

Expected Output:

Moved 10 meters
Topics:
Interfaces
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.