Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Prog54H {
- public static void main(String[] args){
- double islandDiameter = 4.16;
- double islandRadius = islandDiameter / 2;
- double Pi = 3.14159;
- double islandArea = islandRadius * islandRadius * Pi;
- double lakeRadius = 0.95;
- double lakeArea = lakeRadius * lakeRadius * Pi;
- double amtLand = islandArea - lakeArea;
- amtLand = (int)(amtLand * 1000 + 0.5)/1000.000;
- System.out.println("An island with a 4.16 mile diameter and 0.95 mile radius lake has "+ amtLand + " square miles of cultivatable land");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement