I'm not asking for all the answers just if someone can help guide me in the right direction here since I have no idea where to even start on this thing.
I'm taking an intro to Java class and have this final HW assignment that if I botch, well I fail. I was out for a few weeks due to a couple deaths so I have till tonight at 10:30 to get this in.
Here is some of the question:
You have to create a program that can compute the Surface Area and Volumes of various containers that are all "Right Prisms". This means that the ends of the container are identical and the sides are perpendicular to the ends.
Each of your containers has different shapes: Circular, Rectangular, Triangular, and Regular Polygon. All of these containers are derived from a common abstract Container class.
You will then create a class called ContainerCollection which will contain an array of all of the possible Container classes. This class will provide methods to compute the totalVolume and the totalSurfaceArea of all Containers in the ContainerCollection.
Link to Gist:
https://gist.github.com/3b9fb22e72b2a3d86e1b
Text for those who can't get gist:
abstract class Container { double height; Container(double height) { this.height = height; } abstract double getTopArea(); abstract double getTopPerimeter(); double getVolume() { return height * getTopArea(); } double getSurfaceArea() { return 2*getTopArea() + height * getTopPerimeter(); } } class CircularContainer extends Container { // add appropriate data definitions CircularContainer(double height, double radius) { // Fill in details } // implement required abstract methods } class RectangularContainer extends Container { // add appropriate data definitions RectangularContainer(double height, double width, double length) { // Fill in details } // implement required abstract methods }