Advertisement
waytoofoxy

Untitled

Mar 29th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.         double volume;
  2.         double radius;
  3.         double height;
  4.         double cost;
  5.         boolean done = false;
  6.         String donecheck;
  7.         while(!done){
  8.             System.out.println("Input the Volume");
  9.             volume = input.nextDouble();
  10.             System.out.println("Input the radius");
  11.             radius = input.nextDouble();
  12.             height = volume / (Math.PI*radius*radius);
  13.             cost = 2*Math.PI* radius*(radius + height);
  14.             System.out.println("Radius is " + radius);
  15.             System.out.println("Cost is " + cost);
  16.             System.out.println("Type y if you wish to continue");
  17.             donecheck = input.nextLine();
  18.             if(donecheck == "y"){
  19.                 done = true;
  20.             }else{
  21.                 done = false;
  22.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement