Question: Write a class definition for Point, which represents a point in the Cartesian coordinate system (i.e., x and y). Your Point class should include a

Write a class definition for Point, which represents a point in the Cartesian coordinate system (i.e., x and y). Your Point class should include a default constructor and the following member function:

// set the point to values x, y

void set ( double x, double y );

Overload the << operator to display the point's coordinates.

Then write a small main function that uses a variable of type Point, sets it to the coordinates ( 2.5, 4 ) , and displays its coordinates on cout.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!