Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I understand the program is long and tedius, I need help any way possible. Write in C + + please. Will like the answer if
I understand the program is long and tedius, I need help any way possible. Write in C please. Will like the answer if helpful!! Write a class Point that represents a point on the screen. Hence it has an and coordinate which are integers You should write a class definition and the following functions you must decide if they are members or friends a A constructor which is passed two integers, consider whether to use default values. b A copy constructor. c A translate function which is passed a Point and changes the coordinates using the passed in Point. If the original point is and the point is passed in then the new coordinates are given by the formulas: Note, this function can be implemented using operator overloading. d A move to function. This function is passed a Point and moves the original point to the passed in Point. e A rotate function which is passed an angle and rotates the point by that amount. If the original point is and the angle of rotation is then the new coordinates are given by the formulas: f A distance function that gives the distance between two points. The formula for the distance between xy and is: g A function that determines if a point is on a given line. The information for the line would be passed in as a slope and a specific point on the line. Hint: use the pointslope formula for a line. h Functions to access the and coordinates. There should be three such functions. One that returns the coordinate, one that returns the ycoordinate and one that returns the Point. i Functions to modify the and coordinates. j Overload the assignment operator. k A function called invert that switches the and coordinates. l A function that is passed two points and finds the midpoint between them. m A function to convert the point into polar coordinates The conversion equations are: n Overload the input and output operators.
I understand the program is long and tedius, I need help any way possible. Write in C please. Will like the answer if helpful!!
Write a class Point that represents a point on the screen. Hence it has an and coordinate which are integers
You should write a class definition and the following functions you must decide if they are members or
friends
a A constructor which is passed two integers, consider whether to use default values.
b A copy constructor.
c A translate function which is passed a Point and changes the coordinates using the passed in Point. If the
original point is and the point is passed in then the new coordinates are given by the formulas:
Note, this function can be implemented using operator overloading.
d A move to function. This function is passed a Point and moves the original point to the passed in Point.
e A rotate function which is passed an angle and rotates the point by that amount. If the original point is
and the angle of rotation is then the new coordinates are given by the formulas:
f A distance function that gives the distance between two points. The formula for the distance between xy
and is:
g A function that determines if a point is on a given line. The information for the line would be passed in as a
slope and a specific point on the line. Hint: use the pointslope formula for a line.
h Functions to access the and coordinates. There should be three such functions. One that returns the
coordinate, one that returns the ycoordinate and one that returns the Point.
i Functions to modify the and coordinates.
j Overload the assignment operator.
k A function called invert that switches the and coordinates.
l A function that is passed two points and finds the midpoint between them.
m A function to convert the point into polar coordinates The conversion equations are:
n Overload the input and output operators.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started