Deiancom

Birthday

Jun 8th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Birthday {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         int length = Integer.parseInt(scanner.nextLine());
  9.         int width = Integer.parseInt(scanner.nextLine());
  10.         int height = Integer.parseInt(scanner.nextLine());
  11.         double sandPercent = Double.parseDouble(scanner.nextLine());
  12.         sandPercent = sandPercent * 0.01;
  13.         double volume = length*width*height;
  14.         volume = volume * 0.001;
  15.         double liters = volume * (1-sandPercent);
  16.         System.out.printf("%.3f", liters);
  17.  
  18.     }
  19. }
Add Comment
Please, Sign In to add comment