1. Create a new Windows Forms Project

2. Add a ClassLibrary to the project - Rectangular Shapes Library

3. If you are unsure of the formula for Perimeter() Area() or Volume() of a given shape you can google it to get the formula.

4. Add a Class Square:

  • private int _length;
  • Add a constructor Square(int length)
  • Add the properties Length
  • Add the Methods Perimeter() and Area() which will return the calculated value

5. Add a class Rectangle which inherits from Square:

  • private int _width
  • Add a constructor Rectangle(int length, int width)
  • Override any Properties and Methods which are different for a Rectangle than a Square

6. Add a class Box which inherits from Rectangle:

  • private int _height
  • Add a constructor Box(int length, int width, int height)
  • Override any Properties and Methods which are different for a Box than a Square

7. Add a class RectangularPyramid which inherits from Box:

  • Add a constructor RectangularPyramid(int length, int width, int height)
  • Override any Properties and Methods which are different for a RectangularPyramid than a Box

8. In Form1 Add Buttons to create and display each of these types of shapes in a ListView

9. In Form1 Add a Method that will return a list of only one particular type of shape (Square, Rectangle, Cube, Rectangular Pyramid)

10. Call this method from a button and display only the shapes which match the type in the ListView

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.