Advertisement
Kancho

Removal

Feb 4th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Mooving {
  4. public static void main(String[] args) {
  5.  
  6. Scanner keyboard = new Scanner(System.in);
  7.  
  8. System.out.print("With: ");
  9. int width = keyboard.nextInt();
  10. System.out.print("Depth: ");
  11. int depth = keyboard.nextInt();
  12. System.out.print("Height: ");
  13. int height = keyboard.nextInt();
  14. int roomVolune = width * depth * height;
  15. System.out.println(roomVolune);
  16. String input = keyboard.next();
  17.  
  18.  
  19. while (!input.equalsIgnoreCase("Done")) {
  20. int boxes = Integer.parseInt(input);
  21. roomVolune = roomVolune - boxes;
  22. if (roomVolune < boxes) {
  23. break;
  24. }
  25. input = keyboard.next();
  26. }
  27. if (roomVolune < 0) {
  28. System.out.printf("You need moore %d cubic meters ", Math.abs((roomVolune)));
  29. } else if (0 <= roomVolune) {
  30.  
  31. System.out.printf("You have more %d cubic meter left", (roomVolune));
  32. }
  33.  
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement