Problem statement
Implement a class Point that has three properties and a method. All these attributes (properties and methods) should be public. This problem can be broken down into two tasks:
Task 1
Implement a constructor to initialize the values of three properties: x, y, and z.
Task 2
Implement a method, sqSum(), in the Point class which squares x, y, and z and returns their sum.
Sample properties
1, 3, 5
Sample method output
35
1 of 3
Coding exercise
First, take a close look at the slides above and then design a similar step-by-step algorithm before jumping to its implementation. This problem is intended for your practice, so initially try to solve it on your own. If you get stuck, you can always refer to the solution provided in the next lesson.