Question: 1. a) Add the prototype of a new member function called quadrant to the Point class. This method will return the quadrant in which the
1. a) Add the prototype of a new member function called quadrant to the Point class. This method will return the quadrant in which the point is located. Quadrant numbers are shown in Figure I below. Member function quadrant should have a return type different than void. Don't write the definition of the member function quadrant in point.h file b) Add the prototype of a member function midPoint (....) to the class Point which creates an object of class Point as a midpoint of two objects of class Point. (Use only one formal parameter and determine the return type of function midpoint). Don't write the definition of the member function midPoint (....) in point.h file. e) Add the prototypes of two new overloaded member functions distance. One of them determines the distance of point to the origin( 0) and the other one determines the distance from one object of class Point to another object of class Point.( (The first one does not have formal parameters and the second one has only one formal parameter. For both functions distance the return type is double. Don't write the definition of the member functions distance in point.h file. pointh #ifndef POINT 11 #define POINT H class Point t public: default constructor (creates Point at origin) Point) II Create Point using x-y coordinates Point(double xx, double yy): I/ prototype of member function midpoint Fig. I. Quadrants midPoint( ); double getx O; void setXY( double xx, double yy): double gety O I prototype of member function quadrant quadrant. Il prototype of member function distance to another point void printO private double x double y : #endif (For .h file-30 points; for implementation cpp file -30 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
