/** * Author: Josiah Yoder et al. * Class: SE1011-011 * Lesson: Week 6, Day 1 */ /* * A spherical object */ public class BeachBall { // Attributes private double radiusCm; private double volumeCm3; private Color color; // Methods public double getPercentInflated() { double maxVolumeCm3 = (4.0/3.0)*Math.PI*Math.pow(radiusCm,3); // double maxVolumeCm3 = 4.0/3.0*Math.PI*r^3; return volumeCm3/maxVolumeCm3*100; } public setRadiusCm(double radiusCm) { this.radiusCm = radiusCm; } }