Question: .In C++ Write the code that would be in the file Point2D.h for the class Point2D. The class should model a two - dimensional point

.In C++

Write the code that would be in the file Point2D.h for the class Point2D. The

class should model a two

-

dimensional point (x, y), where x is the horizontal

component of the point and y is the vertical component of the point. The x

and y components of the point are the basic data for the class.

?The class should contain a default constructor that sets the x and

y components

to zero.

?The class should contain a constructor that takes values to assign to the x and y

components.

?The class should contain accessor and mutator functions for the x component of

the point. (NOTE: Remember the accessor functions are

the get functions,

while the mutator functions are the set functions.)

?The class should contain accessor and mutator functions for the y component of

the point.

?The class should contain a member function, Scale, that will scale x and y

components of the point by the scale value passed to the function Scale.

?The class should contain Read and Write functions.

?The Read function should be able to read from the keyboard or from a file.

?The Write function should be able to write to the monitor

or to a file.

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!