/* Task: Write a member function in the class Point which relects the point (a,b) about the x axis and then about the y axis */ #include "reflect.h" #include <cmath> /*semi colon ; gets replace by the definition of the member function.*/ Point ::Point() {x0=x1=0;} Point::Point(double a, double b) { x0= a; x1=b; } double Point::Reflect_x() { //x1=-b; return -x1; } double Point::distance_origin() { return sqrt(x0*x0+x1*x1); } int main() { double a,b; cout<<"Please enter the X coordinate"<<endl; cin>>a; cout<<"Please enter the Y coordinate"<<endl; cin>>b; Point X(a,b) ; cout<<"The coordinate reflected across the x axis is ("<<a<<","<<X.Reflect_x()<<")"<<endl; cout<<"The distance from the origin is "<<X.distance_origin()<<endl; return 0; }