Question: Continue the Shape problem. Complete the following main function. #include Shape.h #include Circle.h #include Square.h #include using namespace std ; int main () { //
Continue the Shape problem. Complete the following main function. #include "Shape.h" #include "Circle.h" #include "Square.h" #includeusing namespace std; int main() { // define an array with 2 elements // decide the type of the elements to achieve polymorphism // create a circle object with radius = 5 and add to the array // create a square object with side = 10 and add to the array // using the elements in the array to call getArea() function to calculate and display areas of the circle and square object return 0; } Continue the Shape problem. Complete the following main function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
