Java Reference
In-Depth Information
/**
* @param length the length to set
*/
public void setLength(double length) {
this.length = length;
}
/**
* Calculate the volume
* @return
*/
public double calculateVolume(){
double avgDepth = (minDepth+maxDepth)/2;
return avgDepth * length * width;
}
/**
* Returns the number of gallons for a given Volume
* @param vol
* @return
*/
public double calculateGallons(Volume vol){
return 7.48 * vol.calculateVolume();
}
/**
* @return the minDepth
*/
public double getMinDepth() {
return minDepth;
}
/**
* @param minDepth the minDepth to set
*/
public void setMinDepth(double minDepth) {
this.minDepth = minDepth;
Search WWH ::




Custom Search