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 with the x and y coordinates. Circle Class with an 1,

C++ please image text in transcribed
image text in transcribed
Write a C++ program that defines the following Geometric Classes: Point Class with the x and y coordinates. Circle Class with an 1, y coordinates and radius. Cylinder Class with an x, y coordinates, radius and height. 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 uses the following structure: Shapes Point ptArr[ MAX_SIZE); Circle cirArr( MAX_SIZE]: Cylinder cylArr[ MAX_SIZE]: Number of objects not to exceed MAX_SIZE of 10. Call the functions: displayPoints( Point ptArr(1), displayCircles(Circle cirArr(1) 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 Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

Understand the requirements for diversity management

Answered: 1 week ago

Question

How would a TM strategy help this company?

Answered: 1 week ago

Question

Outline key ideas in human resource accounting

Answered: 1 week ago