Create a class called Point3D to represent 3D point in space, a class called Sph
ID: 3557508 • Letter: C
Question
Create a class called Point3D to represent 3D point in space, a class called Sphere and a class called Cylinder. The sphere is characterized by its center point and the radius while the Cylinder can be characterized by its center point, radius and height..
In your design provide a constructor for each class that enables an object of this class to be initialized when it is declared. The constructor should contain default values in case no initializers are provided. Provide public member functions to set/get private data members, to calculate the surface area and the volume for each class in the hierarchy. You must write you code in two different approaches:
Explanation / Answer
hi this is ur program
class point3d
{ point3d() x' = x
A Program Demonstrating the Point3D Class
To demonstrate the Point3D class you are to write a program the generates points on the surface of simple shapes. Consdier how we can use the Point3D member functions to produce a series of points on a cylinder. We begin with a single point on the x-axis a distance r from the origin:
We can generate a series of points on a circle in the x,y plane by incrementally rotating p1 about the z-axis:
where PI is a constant approximating the number pi.
We can generate points on a cylinder by progressively shifting our circle up the z-axis:
so this isk ur progrmae
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.