#include #include class shape { protected: double x,y; public: virtualvoid get_data()=0; virtualvoid display_area()=0; }; class triangle : public shape { public: void get_data(void) { cout<<\"\ \ =====Data Entry for Triangle=====\ \ \"; cout<<\"Enter base and height respectively : \"; cin>>x>>y; } void display_area(void) { cout<<\"\ \ =====Area of Triangle=====\ \ \"; double aot; aot = 0.5 * x * y; cout<<\"Area of Triangle is \"<>x>>y; } void display_area(void) { cout<<\"\ \ =====Area of rectangle=====\ \ \"; double aor; aor = x * y; cout<<\"Area of Rectangle is \"<>choice; switch(choice) { case 1 : list[0]->get_data(); list[0]- >display_area(); getch(); break; case 2 : list[1]->get_data(); list[1]- >display_area(); getch(); break; case 3 : goto end; default: cout<<\"\ \ Invalid choice\ Try again\ \"; getch(); } } end: } Solution #include #include class shape { protected: double x,y; public: virtualvoid get_data()=0; virtualvoid display_area()=0; }; class triangle : public shape { public: void get_data(void) { cout<<\"\ \ =====Data Entry for Triangle=====\ \ \"; cout<<\"Enter base and height respectively : \"; cin>>x>>y; } void display_area(void) { cout<<\"\ \ =====Area of Triangle=====\ \ \"; double aot; aot = 0.5 * x * y; cout<<\"Area of Triangle is \"<>x>>y; } void display_area(void) { cout<<\"\ \ =====Area of rectangle=====\ \ \"; double aor; aor = x * y; cout<<\"Area of Rectangle is \"<>choice; switch(choice) { case 1 : list[0]->get_data(); list[0]- >display_area(); getch(); break; case 2 : list[1]->get_data(); list[1]- >display_area(); getch(); break; case 3 : goto end; default: cout<<\"\ \ Invalid choice\ Try again\ \"; getch(); } } end: }.