Question: c++ 1. Define an abstract base class called BasicShape. The BasicShape class should have the following members: (Reference: Fig 12.9 and 12.10) a) Protected Member
c++
1. Define an abstract base class called BasicShape. The BasicShape class should have the following members: (Reference: Fig 12.9 and 12.10) a) Protected Member Variable: area (a double used to hold the shape's area). b) Private Member Variable: name (a string to indicate the shape's type) c) Constructor and Public Member Functions: - BasicShape(double a, string n ): A constructor that sets value of member area with a and member name with n. - calcArea(): This public function should be a pure virtual function. - print(): A public virtual function that only prints the value of data member area - getName0:A public function that returns the value of data member name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
