Question
Write a class named 'cylinder' that inherits from the 'circle' and 'rectangle' classes. The 'cylinder' class must not have any member data. All member functions
Write a class named 'cylinder' that inherits from the 'circle' and 'rectangle' classes. The 'cylinder' class must not have any member data. All member functions of the 'cylinder' class will be located in the 'public' section. The member functions to be defined are explained below. I. The 'write size' function will take two real numbers (floats) as parameters. The first parameter should be the height of the cylinder and the second parameter should be the radius of the cylinder (r). ii. The 'find surface area' function will return the surface area of the cylinder. iii. The 'find volume' function will return the volume of the cylinder. (base area x height). iv. The '++' operator will increase the cylinder height by 1.
#includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started