Advertisement
marking2112

BirthDay

Jun 6th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P14BirthDay {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         Double lenght = Double.parseDouble(scanner.nextLine());
  9.         Double width  = Double.parseDouble(scanner.nextLine());
  10.         Double height = Double.parseDouble(scanner.nextLine());
  11.         Double percentage = Double.parseDouble(scanner.nextLine());
  12.  
  13.         Double volume = lenght * width * height;
  14.         Double litres = volume * 0.001;
  15.         Double percentagevolume = percentage * 0.01;
  16.  
  17.         Double result = litres *(1 - percentagevolume);
  18.  
  19.         System.out.printf("%.3f", result);
  20.        
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement