Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions