/* Pool.java -- Simple example class that models a swimming pool. When * designing the Pool class, we ask ourselves 2 questions: * What are the basic attributes of a pool? (length, width, depth) * What do we want to calculate about a pool? (volume of water) */ public class Pool { // attributes, measured in feet double length; double width; double depth; // constructor public Pool (double l, double w, double d) { length = l; width = w; depth = d; } /* Now we are ready to write the volume function. Note that * 7.8 gallons make one cubic feet of water. */ double findVolume() { return 7.8 * length * width * depth; } }