/* * Paper.java * * Created on April 13, 2003, 3:45 PM * * * For any methods that are specified here, please use exactly the method * signatures given: method name, return type, paramters. */ /** Class Paper. A rectangular piece of paper. The length is always the larger dimension. * The paper can have a rectanglar portion cut out of it, yielding a new * piece of paper, plus new dimensions for the current piece of paper. * */ public class Paper { /** Creates a new instance of Paper. The dimensions given as parameters may be in either order, but the larger is considered to be the length, and the shorter is the width. */ public Paper(double dimension1, double dimension2) { } /** Return the value of the length of the paper (the longer dimension) */ //public double getLength() { /** Return the value of the width of the paper (the shorter dimension) //public double getWidth() { /** Makes a cut in this piece of paper, if possible. * The cut is considered to be taken from a corner (visualize it as the upper left corner), with the larger * cut dimension coming from the length, and the shorter from the width. * The parameters are in no special order. * For the cut to succeed, the requested cut dimensions must not be greater * that the current dimensions. * After the cut, there are two choices about what to keep: the lower half of * the remaining paper, or the righthand side of the remaining paper. * The one with the larger total dimensions (length + width) is chosen; * I.e., the dimensions of the current piece of paper * are updated (to those of the "saved" piece). * @return true if the cut was successful; return false if the cut was not * done for any reason. */ //public boolean cut(double cutDim1, double cutDim2) { //end class Paper }