Question: C++ Question 3: (1.5 mark) What is the base class, constructors, mutators, accessors and derived class? Predict the output class Shape { public: Shape() {


C++
Question 3: (1.5 mark) What is the base class, constructors, mutators, accessors and derived class? Predict the output class Shape { public: Shape() { side = ; } void setSide(float s) { side = 5; } float getSide() { return side; } protected: float side; class Square : public Shape { public: float getArea() { return (side * side) } float getPerimeter() { return (4 * side); } class ETriangle : public Shape { public: float getArea) { area - sqrt(float(3)) / 4 (side side); return area; } float getPerimeter() { peri - 3. side; return peri; } protected: float area; float peri; float main(void) { Square squ; ETriangle tri; char choice; float c,s; bool run - true; while (run) { cout > C; if (c 1) { cout > S; squ.setSide(s); cout else if (c - 2) cout > S; tri.setSide(s); cout > choice; if (choice - 'N' || choice - 'n'){ run - false; } system("pause"); return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
