Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 nameStep 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