Answer:
#include <iostream>
#include <iomanip>
using namespace std;
class pointType
{
public:
pointType()
{
x=0;
y=0;
}
pointType::pointType(double x,double y)
{
this->x = x;
this->y = y;
}
void pointType::setPoint(double x,double y)
{
this->x=x;
this->y=y;
}
void pointType::print()
{
cout<<"("<<x<<","<<y<<")\n";
}
double pointType::getX()
{return x;
}
double pointType::getY()
{return y;
}
private:
double x,y;
};
int main()
{
pointType p2;
double x,y;
cout<<"Enter an x Coordinate for point ";
cin>>x;
cout<<"Enter an y Coordinate for point ";
cin>>y;
p2.setPoint(x,y);
p2.print();
system("pause");
return 0;
}