Q3: Create a base class to represent a three dimensional shape, it has one private double variable (height), and two member functions which are used to set and get this member variable. Then create a derived class which is inherited from the hasc class, this class has one private double member radius, and two public member functions: the first one is used to set the value of the radius, and the second one is used to return the volume of the cylinder using the formula: votume = r²nh. %3D

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 3PE: Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the...
icon
Related questions
Question
Q3: Create a base class to represent a three dimensional shape, it has one private double
variable (height), and two member functions which are used to set and get this member
variable. Then create a derived class which is inherited from the base class, this class has one
private double member radius, and two public member functions: the first one is used to set
the value of the radius, and the second one is used to return the volume of the cylinder using
the formula: volume = r'nh.
Transcribed Image Text:Q3: Create a base class to represent a three dimensional shape, it has one private double variable (height), and two member functions which are used to set and get this member variable. Then create a derived class which is inherited from the base class, this class has one private double member radius, and two public member functions: the first one is used to set the value of the radius, and the second one is used to return the volume of the cylinder using the formula: volume = r'nh.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,