Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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;

image text in transcribed
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

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

Step: 3

blur-text-image

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is human nature?

Answered: 1 week ago