C++ PLS COMPLETE THE TASK EXACTLY AS IT SAYS. SCREENSHOT THE OUTPUT.
Make a object-oriented program to print position of vertices for 3 different figures.
3.3 Task Three: Make a object-oriented program to print position of vertices for 3 different figures. (20 marks) (1) class Point is declared as below: class Point private: double x,y,z; public: Point(){x=0.0; y=0.0; z=0.0; } init(double xx, double yy, double zz) { X=XX; y=yy; Z=Zz; } void print() { cout<<"("<<x<<","<<y<<","<<z«<")"<<endl; } double getX() { return x; } double getY(){ return y;} double getz() { return z;} }; (2) class Object3d is declared as: class Object3d 코{ private: Point *aPtr; int nvertices;//quad=4||pyramid=5||cube=8; int figure;//1-quad||2-pyramid|l3-cube; public: Object3d(Object3d &); Object3d(int type);//1-quad|/2-pyramid||3-cube; ~Object3d() { if (nvertices > 0) delete [] aptr; } void print(); }; (3)Example running result is shown as below: Please create data for a 3D shape: 1: Quad (2 units in the edge, centerd in origin on XY plane.) 2: Pyramd (2 units in the edge and height, centerd in origin of 3D space.) 3: Cube (2 units in the edge, centerd in origin of 3D space.) 1 The 3D object has 4 vertices: (x, y, z) (-1,-1,0) (1,-1,0) (1, 1, 0) (-1, 1, 0) (4) Please finish Object3d.cpp and main function. Run the program and capture screenshots of output
3.3 Task Three: Make a object-oriented program to print position of vertices for 3 different figures. (20 marks) (1) cla
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
3.3 Task Three: Make a object-oriented program to print position of vertices for 3 different figures. (20 marks) (1) cla
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!