Assignemnt: Geometric Solids
Write a Python program with a class for rectangular prisms and a subclass for cubes that will calculate volume and surface area of these geometric solids. Use the specs below to guide you through the process.
1. Create a RectangularPrism class that has three instance variables for the three dimensions of a rectangular prism (length, width, and height).
2. Create a class method named volume that will return the volume of a rectangular prism. The formula for calculating the volume is to multiply the three dimensions.
3. Create another class method named surfaceArea that will return the surface area of a rectangular prism. The formula for calculating the surface area is to sum the areas of all six faces.
4. Create a Cube class that is a subclass of the RectangularPrism class. The Cube class only needs one argument since all three dimensions are the same length. Use the argument for each of the three dimensions.
5. Do not create new class methods for volume and surfaceArea in the Cube class because they are inherited from the RectangularPrism class.
6. Download and unzip the attached file. Either copy your code with the two classes to the top of this file or copy the code from this file to the bottom of your code. Add repr () methods to your classes so that when the program is run the output will look as shown below.
Rectangular Prism with length 2 width 3 and height 4
Volume = 24
Suface Area = 52
Cube with side 2
Volume = 8
Suface Area = 24