/*******************************************************************************
 *  Program Title:  Tub
 *  Files:          Babcock.java Scooper.java Tub.java
 *  Main Class:     Babcock
 *
 *  Author:  Brian Lee Bowers     blbowers@cs.wisc.edu
 *  Collaborators:  NONE
 *
 *  Due Date:  NONE
 *  Date Completed:  14 February 2001
 *
 *  Compiler:  Sun JDK javac (JDK 1.2.2)
 *  Platform:  SunOS 5.6 (Intel x86)
 ******************************************************************************/


/**
 *  A tub of ice cream.
 */
public class Tub {

	/**  number of quarts initially in the tub [0.0, infinity) */
	private double myQuarts;

	/**  a conversion factor from quarts to cubic inches  */
	private final double INCHES_PER_QUART = 57.75;

	/**
	 *  Class constructor - given a quantity in quarts.
	 *
	 *  @param quarts the initial number of quarts [0.0, infinity)
	 */
	public Tub(double quarts) {
		myQuarts = quarts;
	}

	/**
	 *  Get the volume, in cubic inches, of the tub.
	 *
	 *  @return the volume in cubic inches
	 */
	public double getVolume() {
		return convertQuartsToInches(myQuarts);
	}

	/**
	 *  Convert number of quarts to volume in cubic inches.
	 *  A quart is 57.75 cubic inches.
	 *
	 *  @param quarts the number of quarts to be converted
	 *  @return the volume in cubic inches
	 */
	private double convertQuartsToInches(double quarts) {
		return (quarts * INCHES_PER_QUART);
	}
}
		
