Task 3 of 10 · 0 solved · 10 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

4.1 Objects and fields — sum of coordinates

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

The class Point is written above. Fill in sumCoords so that it returns the sum of the point's two fields.

For the point in main the program prints 7. Reach the fields with p.x and p.y.

Your solution