Question: C++, coding on code:: Blocks Minilab Inheritance 1. As you do the steps, but sure to fill in the syour answer here> parts... Also, be

 C++, coding on code::Blocks Minilab Inheritance 1. As you do the

steps, but sure to fill in the syour answer here> parts... Also,

be sure to do them IN ORDER. 2. There is a class

C++, coding on code::Blocks

Minilab Inheritance 1. As you do the steps, but sure to fill in the syour answer here> parts... Also, be sure to do them IN ORDER. 2. There is a class called Rectangle for this Minilab. It defines a geometric rectangle open it and look at it to see if it makes sense. Now that you have a Rectangle class to work with, the following 3 statements should work. and check the results. 3. Run the Minilabinheritance program 4. Go back to the Rectangle class and change it so that its data can be INHERITED by subclasses (but still cannot be seen or changed from another class). 5. There is a class called Square for this Minilab. It will basically be a blank class. Change it so that it is a SUBCLASS of Rectangle. (Do not give it ANY data it should be able to inherit from its parent class.) 6. Write a constructor for vour Square class. The constructor should receive a he Internet can contain viruses. Unless you need to edit, it's safer to stay in Protected View Enable Editing 6. Write a constructor for your Square class. The constructor should receive a SINGLE double which will be the length of each side. Since it has (inherited) data of length and width, set the length AND the width to what is passed in (or... it can call the superclass's constructor with the single int that it has) 7. Uncomment the following 2 statements, recompile, and run this program. Thefnih the Question in the cout' below, and run egain. 8. Now go to your Square class and "override" the inherited toString) method by writing a specific toString() method for Square. Have it return "I am a Square with sides- keither the length or the width here Uncomment the following 2 statements, and run this program. Then finish the Question in the "cout" below, and run again. 9. 10. Uncomment the following statement. Then run. Then finish the Question in the "cout" below, and run again. 11. Be SURE that you have filled in the your answer heres parts (like directly above). Also, be sure that you understand the results- basically, Square is a special case of Rectangle so it can be a subclass. This allows it to inherit data/methods as well as have its own. Submit your zipped mlinheritance project via Canvas

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!