1. Engineering
  2. Computer Science
  3. c...

Question: c...

Question details
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 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 << endl; p2.display()
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution