/** Planet.java -- this file will define the attributes and operations for * a Planet object. Sept. 17, 2002. */ public class Planet { // attributes double radius; double percentWater; /** initial value constructor takes a radius and percent water */ public Planet (double r, double p) { radius = r; percentWater = p; } /** operations -- define functions that find the volume of the planet * as well as land area * We assume that the planet is in the shape of a sphere. */ double findVolume() { return (4.0/3.0) * Math.PI * Math.pow (radius, 3.0); } double findLandArea() { double totalArea = 4.0 * Math.PI * radius * radius; double landArea = totalArea - percentWater / 100.0 * totalArea; return landArea; } }