Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: Generate a C++ object-oriented project that models the following descriptions 1. The project contains three classes, i.e., Point2D, Circle, and Cylinder where Circle is-a

image text in transcribed

Problem: Generate a C++ object-oriented project that models the following descriptions 1. The project contains three classes, i.e., Point2D, Circle, and Cylinder where Circle "is-a" Point2D, and Cylinder "is-a" Circle. The "is a" relationship is modeled by public inheritancie All classes must have a default constructor and constructor-initializer which takes as many parameters as needed to initialize the existing data members 2. 3. 4. All classes have set and get functions included into the public section. 5. Classes Circle and Cylinder have a public method called area(...). 6. All classes have a public method equal(...) testing the equality of two objects of the same class Design two non-member function distance(...) calculating a) the distance from the origin to object of class Circle; b) the distance between the centers of two obiects of class Circle.. Design two member functions distance(...) calculating: a) the distance from the origin to an object of class Circle; b) the distance between the centers of two obiects of class Circle 7. 8. 9. Class Cylinder contains a member function volume(...). 10. Class Point2D contains two private data members x and y, both of type int, class Circle has one private data member radius of type double and class Cylinder has one private data member height of type double corresponding data members. a) Create 2-3 objects each of the above classes implementing all member 11. All classes contain public print(..) showing the values stored into the 12. The main (driver) program must functions included into them as well as the two non-member functions of (7) b) Object Pointers with dynamic allocation. c) Reference (alias) to an existing object. d) Three arrays of objects of the three classes e) Three arrays of low dimension (2-3) of Object Pointers for the three classes Problem: Generate a C++ object-oriented project that models the following descriptions 1. The project contains three classes, i.e., Point2D, Circle, and Cylinder where Circle "is-a" Point2D, and Cylinder "is-a" Circle. The "is a" relationship is modeled by public inheritancie All classes must have a default constructor and constructor-initializer which takes as many parameters as needed to initialize the existing data members 2. 3. 4. All classes have set and get functions included into the public section. 5. Classes Circle and Cylinder have a public method called area(...). 6. All classes have a public method equal(...) testing the equality of two objects of the same class Design two non-member function distance(...) calculating a) the distance from the origin to object of class Circle; b) the distance between the centers of two obiects of class Circle.. Design two member functions distance(...) calculating: a) the distance from the origin to an object of class Circle; b) the distance between the centers of two obiects of class Circle 7. 8. 9. Class Cylinder contains a member function volume(...). 10. Class Point2D contains two private data members x and y, both of type int, class Circle has one private data member radius of type double and class Cylinder has one private data member height of type double corresponding data members. a) Create 2-3 objects each of the above classes implementing all member 11. All classes contain public print(..) showing the values stored into the 12. The main (driver) program must functions included into them as well as the two non-member functions of (7) b) Object Pointers with dynamic allocation. c) Reference (alias) to an existing object. d) Three arrays of objects of the three classes e) Three arrays of low dimension (2-3) of Object Pointers for the three classes

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions