H.W: Modify class Point to represent points in 3D instead of 2D. using namespace std;// class declaration sectionclass Point{private:double x;double y;public:Point (double idx = 0.0, double...


H.W: Modify class Point to represent points in 3D instead of 2D.


#include <iostream><br>using namespace std;<br>// class declaration section<br>class Point<br>{<br>private:<br>double x;<br>double y;<br>public:<br>Point (double idx = 0.0, double idy = 0.0)<br>// constructor<br>x = idx;<br>y = idy;<br>void show ()<br>{<br>cout << show (); cout < "the="" coordinates="" of="" point2="" is:="" ";="" ptrpoint="&point2;" ptrpoint-="">show (); return 0; Microsoft Visual Studio Debug Console The coordinates of Point1 is: The x coordinate is: 4, The y coordinate is: 6 The coordinates of Point2 is: The x coordinate is: 8, The y coordinate is: 9 "/>
Extracted text: #include using namespace std; // class declaration section class Point { private: double x; double y; public: Point (double idx = 0.0, double idy = 0.0) // constructor x = idx; y = idy; void show () { cout < "the="" x="" coordinate="" is:="" "="">< x="">< ",="" the="" y="" coordinate="" is:="" "="">< y="">< endl;="" };="" int="" main="" ()="" {="" point="" *ptrpoint;="" declares="" point="" pointer="" point="" point1="" (4,="" 6);="" creates="" point="" object="" point="" point2="" (8,="" 9);="" creates="" point="" object="" cout="">< "the="" coordinates="" of="" point1="" is:="" ";="" ptrpoint="&point1;" ptrpoint-="">show (); cout < "the="" coordinates="" of="" point2="" is:="" ";="" ptrpoint="&point2;" ptrpoint-="">show (); return 0; Microsoft Visual Studio Debug Console The coordinates of Point1 is: The x coordinate is: 4, The y coordinate is: 6 The coordinates of Point2 is: The x coordinate is: 8, The y coordinate is: 9

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here