class Point3d { public: Point3d(double x, double y, doublez);
Point3d(const point3d& p);
void setX(double x);
void setY(double y);
void setZ(double z);
double getX() const;
double getY() const;
double getZ() const;
point3d& operator=(const point3d& rhs); private: doublex; double y; double z;
};
Given the Point class above, complete the following:
1. Write just the signature for the overloaded addition operatorthat would add the respective x,y, and z from two point3dobjects.
2. What is the output of the code (assuming copy constructor andcopy assignment operators are properly implemented).
point3d p1{3,4,5};
point3d p2{p1};
p2.setY(2*p2.getX());
point3d* p3 = new point3d{p1.getX(), p2.getY(), p2.getZ()};
p3 = &p1; cout << *p3.getZ() << endl;
p1.setY(2*p1.getZ());
p3.setX(p2.getZ());
p1 = p2; cout << p1.getX() + “, †p1.getY() + “, â€p1.getZ() << endl;
cout << p2.getX() + “, †p2.getY() + “, †p2.getZ()<< endl;
cout << p3.getX() + “, †p3.getY() + “, †p3.getZ()<< endl;
delete p3;