package InterfaceDemo;

/**
 * Prism.java
 *
 *
 * Created: Tue Feb 13 20:12:07 2001
 *
 * @author Stuart C. Shapiro
 *
 * The class of regular 3-dimensional solids.
 */

public class Prism extends Solid
    implements Weighable{

    /** The cross section of this prism. */
    private CrossSection crossSection;

    /** The height of this prism. */
    private double height;

    /**
     * Constructs a Prism.
     *
     * @param cs The cross section of this prism.
     * @param h The height of this prism.
     * @param density The density of this prism.
     */
    public Prism (CrossSection cs, double h, double density){
	super(density);
	crossSection = cs;
	height = h;
    }

    /** Returns the weight of this prism. */
    public double getWeight(){
	return crossSection.getArea() * height * density;
    }
}// Prism
