/* Driver.java -- this file contains the main function, performing the * basic 3 steps of input, calculations & output -- we ask user for * the radius and % water of a planet, and tell the volume & land area. */ import java.io.*; // tell compiler we're using I/O public class Driver { public static void main(String [] args) throws IOException { // input phase BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in)); System.out.print("What is the radius of the planet, in miles? "); double radius = Double.parseDouble(kbd.readLine()); System.out.print("What % of the surface is covered with water? "); double percent = Double.parseDouble(kbd.readLine()); // calculations Planet p = new Planet (radius, percent); double volume = p.findVolume(); double landArea = p.findLandArea(); // output System.out.println("\nThe volume is " + volume + " cubic miles."); System.out.println("The land area is " + landArea + " square miles."); } }