Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please!! Write a C++ program that defines the following Geometric Classes: Point Class is now a base class with the x and y coordinates.

C++ please!!
image text in transcribed
image text in transcribed
Write a C++ program that defines the following Geometric Classes: Point Class is now a base class with the x and y coordinates. Circle Class is now derived from the Point class with a radius. Cylinder Class is now derived from the Circle class with a height. All data members in these classes must be declared as "private: In addition, display the total number objects created using the static data member variable. Add a display member function to each class that displays the attributes of the class. Add a data member which holds the class type (i.e. point,circle or cylinder). Add a static data member to each class that counts the number of objects created. In addition, provide a static member function which returns the number of objects created. Write a driver program that prompts the user to enter the desired number of geometric shapes to create with random attribute values. Number of objects not to exceed MAX_SIZE of 10. Store these objects into the appropriate arrays in the structure: struct Shapes{ Point ptArr[MAX_SIZE]; Circle cirArr[MAX_SIZE]; Cylinder cylArr[MAX_SIZE); Call the functions: displayPoints( Point ptArr[]), display Circles (Circle cirArr() and displayCylinders(Cylinder cylArr[]) which invokes the display member function of each element in the array. Random Values: x,y: random #s between 0 and 10 radius: random # between 1 and 15 height: random #s between 1 and 8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions

Question

How does government fit into GDP accounting?

Answered: 1 week ago

Question

=+. What is their reputation?

Answered: 1 week ago

Question

Create a workflow analysis.

Answered: 1 week ago