Question: C++ Write a class named Point that contains an x and y coordinate (integer values Write the implementation with constructors, getters, setters, a display method
Write a class named Point that contains an x and y coordinate (integer values Write the implementation with constructors, getters, setters, a display method and a distance (between 2 points) method. Use const where appropriate. Write a driver (main) to make at least 2 instances of the class and invoke display and distance. Your output should demonstrate that the code works Note: Point.h and main are attached #pragma once class Point ( public: Point(); Point(int, int); void display (); //double distance (Point); private: int mX; int mY; tinclude "Point.h" tinclude kostream> sing namespace std; void main() t Point pl; Point p2(3, 2); p1.display) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
