Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double volume;
- double radius;
- double height;
- double cost;
- boolean done = false;
- String donecheck;
- while(!done){
- System.out.println("Input the Volume");
- volume = input.nextDouble();
- System.out.println("Input the radius");
- radius = input.nextDouble();
- height = volume / (Math.PI*radius*radius);
- cost = 2*Math.PI* radius*(radius + height);
- System.out.println("Radius is " + radius);
- System.out.println("Cost is " + cost);
- System.out.println("Type y if you wish to continue");
- donecheck = input.nextLine();
- if(donecheck == "y"){
- done = true;
- }else{
- done = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement