Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fix this please c++ https://drive.google.com/drive/folders/1q79PiquhIR19zTLt8l7E1f_3cNIMBaNk dont know why its not working these were the requriments Requirements for point: 1a) a .h header file and .cpp

Fix this please c++

https://drive.google.com/drive/folders/1q79PiquhIR19zTLt8l7E1f_3cNIMBaNk

dont know why its not working

these were the requriments

Requirements for point:

1a) a .h header file and .cpp implementation file named Point with Pre and Post Conditions for each member function clearly written in the .h file.

1b) All member functions that should not change the calling object should be const. All parameters that do not get changed should be const. All Point objects passed in should be const reference (i.e. const Point& pointPassedIn)

1c) The point object must have the appropriate state variables. Look at the above figure to determine how many state variables it takes to accurately represent a point and the appropriate data type.

2) A Constructor with default values that either initializes each point to what is passed in, or, if a value is not passed in, intializes the value to 0. This should work as follows

Point firstPoint;//firstPoints (x,y)=(0,0)

Point firstPoint(2.3);//firstPoints (x,y)=(2.3, 0)

Point firstPoint(2.3,-3.2) //firstPoints (x,y)=(2.3, -3.2)

3) An explicitly defined Copy constructor which initializes a point object to be a copy of an existing point object. DEFINE THIS EXPLICITLY (even though you technically do not have to in C++).

5) Getters for the x and y coordinates of a point. These must be named get_x() and get_y() and return a value of the appropriate data type

6) Setters for the x and y coordinates of a point. These must be named set_x(____) and set_y(____) and take in the appropriate parameter value

7) Translation: translate(___,___), Translating a point is equivalent to adding a fixed pair of numbers (x,y) to the cartesian coordinates of the point. So if I translate my point, lets call it pointA at (x,y), by (X,Y) pointA will now be located at coordinates (x+X, y+Y)

8) Scaling: scale(___): Scaling a point is equivalent to multiplying both coordinates of a point by some constant. So if I have pointA at (x,y) and I scale it by m, pointA will now be located at coordinates (m*x,m*y)

9) Reflection: reflect_x(): This reflects the point over the x-axis. If I have pointA at (x,y), after reflecting over the x-axis pointA will now be located at coordinates (x,-y).

reflect_y(): will reflect the point over the y-axis. If I have pointA at (x,y) after reflecting over the y-axis pointA will now be located at coordinates (-x,y)

10) Rotation: Must include cmath for this.

11) Overload the assignment operator (=). This must be explicitly defined (even though C++ gives you a default operator =s if you do not define one).

12) Overload the comparison operator (==). This must be overloaded as a NON-MEMBER. Two points are deemed the same if they are at the same coordinates. Note you do not const a non-member.

13) Overload cin as a FRIEND function. if I have pointA and say cin>>pointA and user types in 12.4 and 13.2 either separated by a space or enter, pointA should now be at the coordinate (12.4,13.2).

14) Overload cout as a FRIEND function. if I have pointA at coordinate (12.4,13.2) and say cout<

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

Students also viewed these Databases questions

Question

2. Outline the business case for a diverse workforce.

Answered: 1 week ago