Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create two classes in separate files: 1. Class circle with property radius (1 point) and appropriate accessor and mutator functions (1 points), and a function

Create two classes in separate files:

1. Class circle with property radius (1 point) and appropriate accessor and mutator functions (1 points), and a function area that calculates the area of the circle.(1 point) 2. Class cylinder with property length that is derived from circle and with property length (1 point), appropriate accessor and mutator functions (1 points) and overrides the function area to calculate the area of the cylinder (1 point).

Test all functionality on both classes. (2 point)

Provide the source code with a comment containing your name, course code and date (1 point). Also provide a screenshot of a sample run. (1 point)

Submit the source code and screenshot in a zip file.

Create an array of pointers to the base class (Circle) of size 4, make area() a virtual function, allocate two objects of class circle and two of class cylinder, assign them to each element in the array and invoke area() for each element in the array (preferably using a loop). (Extra 10 points)

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_2

Step: 3

blur-text-image_3

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

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions