Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC330 Object Oriented Programming (Inheritance) HW1 Problem: Generate a C++ object-oriented project that models the following descriptions: 1. The project contains three classes, i.e., Point2D,

image text in transcribed
CSC330 Object Oriented Programming (Inheritance) HW1 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. 2. The "is a" relationship is modeled by public inheritance. 3. All classes must have a default constructor and constructor-initializer which takes as many parameters as needed to initialize the existing data members. 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. 7. Design two non-member function distance(...) calculating a) the distance from 8. Design two member functions distance(...) calculating: a) the distance from the 9. Class Cylinder contains a member function volume(...) the origin to object of class Circle; b) the distance between the centers of two objects of class Circle.. origin to an object of class Circle; b) the distance between the centers of two objects of class Circle. 0. 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. 11. All classes contain public print(..) showing the values stored into the corresponding data members. 12. The main (driver) program must a) Create 2-3 objects each of the above classes implementing all member functions included into them as well as the two non-member functions of (7). b) Object Pointers with dynamic allocation. e) 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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions