bobski1617

Untitled

Jun 9th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. package USD_BG;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner scanner = new Scanner(System.in);
  9.  
  10.         double legit = Double.parseDouble(scanner.nextLine());
  11.         double wide = Double.parseDouble(scanner.nextLine());
  12.         double tall = Double.parseDouble(scanner.nextLine());
  13.         double percentage = Double.parseDouble(scanner.nextLine());
  14.  
  15.         double capacity = legit * wide * tall;
  16.         double capacityInMeters = capacity * 0.001;
  17.         double stuffSize = capacityInMeters * (percentage/100.0);
  18.         double freeSpace = capacityInMeters - stuffSize;
  19.         System.out.printf("%.2f", freeSpace);
  20.  
  21.  
  22.  
  23.  
  24.         }
  25.  
  26.  
  27.  
  28.  
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment