CSC 160-02: Exercise 9.6 Hint
This question is to be done using
the approach of the Ballooning a Bedroom
problem in Section 9.3 of the reading assignment. So, even though we are
only doing Spheres, there are two parts to this
question:
1) Design and write a surfaceArea() method for the Sphere class.
2) Write a program that uses surfaceArea() to compute the surface area of
a sphere.
These two parts need to be done within two separate classes within a
single project.
--One class is called Sphere. To do that, copy the code from Figure 9-12
into BlueJ, then add a method for surfaceArea.
--The other class can be called Calculator. That is where you can read in
information from the user, call on the surfaceArea method of the sphere
class, and print out the result using System.out.print,println,or printf.
Last Modified: 12/3/09