View the step-by-step solution to:

Derive the cylinder class from the base circle class.

Derive the cylinder class from the base circle class. Assume the circle class has a protected
member variable representing the radius called radius and declared as a double with a default
value of 1.0. It also has a public function called calcVal that evaluates the area of a circle as PI *
radius * radius where PI is a constant 3.14.

In your derived class include an additional protected member representing the length of the
cylinder. Call this variable length. Have the default values for the cylinder class be 1 for both the
radius and the length. For this derived cylinder class include a public function calcVal that
evaluates the volume of the cylinder. (Hint: The volume of the cylinder is length * circle :: calcVal

This question was asked on Oct 13, 2012.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors and customizable flashcards—available anywhere, anytime.


Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access or to earn money with our Marketplace.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
  • -


    Browse existing sets or create your own using our digital flashcard system. A simple yet effective studying tool to help you earn the grade that you want!

    Browse Flashcards