Question: Below based on the following two classes Point 2D and Point 3D: Point 2D class: Two integer field x and y each with accessory (get)
Below based on the following two classes Point 2D and Point 3D: Point 2D class: Two integer field x and y each with accessory (get) and (set) methods. A default constructor that creates a 2D point with 0 values. A constructor that takes 2 int values and creates a point object with the x and y values. A constructor that takes 2 int values and creates a point object with the x and y values. An overload == operator to determine whether two 2D points ate equal or not. An overload > so that we can read a 2D point object from the input stream using an instruction similar to this: cin > > point 1; Point 3D class; Three integer fields: x, y and z each with (get) and mutator (set) methods. A default constructor that creates a 3D point with 0 values. A constructor that takes 3 int values and creates a 3D point object with the x, y and z values. An overload == operator to determine whether two 3D points arc equal or not. An overload > so that we can read a 3D point object from the input stream a) Implement the Point 2D class. b) Implement the Point 3D class. This class should be derived from the Point 2D class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
