Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This should be done in C++ Design and implement a set of classes that define a series of three-dimensional geometric shapes. This design must use

This should be done in C++

Design and implement a set of classes that define a series of three-dimensional geometric shapes. This design must use inheritance, one base class and at least two derived classes. For the shapes store fundamental data about its size and provide methods to access and modify the data. There should be data in the base class and in the derived classes. The data should be template data types, so that instances of the classes can be created with data types of int, double and float. The design should include methods to calculate the circumference, area and volume of the shapes.

An exception class should be created to indicate that one of the data member of the shape is negative. The exception should provide an appropriate message about what it wrong and which data member is wrong and its value. The exception should be thrown when doing the calculations. Main should throw the exception and handle the exception, which then allows the user to enter new value for the data so it can be corrected and the calculations are performed.

The driver class should create an instance of each of the derived classes. The driver should show that all of the method works correctly and the exceptions are handled correctly. The shapes should use different data types to create the instance (int, double, or float).

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 2 Lnai 9285

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Joao Gama ,Alipio Jorge ,Carlos Soares

1st Edition

3319235249, 978-3319235240

More Books

Students also viewed these Databases questions

Question

a valuing of personal and psychological privacy;

Answered: 1 week ago