Question: ainclude eiostreans wing ratcipace std: 3- class Shape ! protected: int width, height: public: Shape ( int a0,13t(b0) inidth(a), helght (b)(t). virtuat int area (0)=0;
ainclude eiostreans wing ratcipace std: 3- class Shape ! protected: int width, height: public: Shape ( int a0,13t(b0) inidth(a), helght (b)(t). virtuat int area (0)=0; 1: class fectande patic shape ( public: rectangle( int a0, int b0) ishape (a,b)(1 int area () (return (width : height): ) 1. - Class triangles poblic Shape \& ptolic Trianctec int a0, int b0) Shape (a,b) () int area () (return (width - Neight (2) ) ht Main function for the program int main() i Shope *shope1, *shope2; Wdymamic allocations for objects of type Rectangle and Triangle shape1 - new Rectangle (10,7); shape 2= new Triangle (10,5); 4 call area method using a shape pointer handle coutseshape 1->area (). H cutput [a] couteeendi
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
