Question: PLEASE solve this question with (C++). Square Areaa Cube Surface Areas-6 x a2 Implement a Square class with the following: i. A. Add one protected

PLEASE solve this question with (C++).
 PLEASE solve this question with (C++). Square Areaa Cube Surface Areas-6

Square Areaa Cube Surface Areas-6 x a2 Implement a Square class with the following: i. A. Add one protected instance variable to the class for side (double). Always choose appropriate names for the instance variables. Implement a default constructor 'no parameters constructor' that initializes side with ZERO. Implement another constructor for the Square class to initialize the instance variable. ii. ili. iv. Implement method calcArea that calculates and returns the area of the square. Implement a Cube class that extends the Square class with respect to the following: i. B. Implement two constructors to initialize the instance variable by calling the base class constructors. Override method calcArea to calculate and returns the area of cube by using the result from the overridden function ii. Create a test class SquareTest to demonstrate Square and Cube capabilities. Show that method calcArea works for both Square and Cube. Don't forget to also test the default constructor. C

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!