Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1.  
  2. public class Prog54H {
  3. public static void main(String[] args){
  4. double islandDiameter = 4.16;
  5. double islandRadius = islandDiameter / 2;
  6. double Pi = 3.14159;
  7. double islandArea = islandRadius * islandRadius * Pi;
  8. double lakeRadius = 0.95;
  9. double lakeArea = lakeRadius * lakeRadius * Pi;
  10. double amtLand = islandArea - lakeArea;
  11. amtLand = (int)(amtLand * 1000 + 0.5)/1000.000;
  12. System.out.println("An island with a 4.16 mile diameter and 0.95 mile radius lake has "+ amtLand + " square miles of cultivatable land");
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement