Helena12

BirthdayGift

Oct 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. import java.text.DecimalFormat;
  2. import java.util.Scanner;
  3. import java.lang.Math;
  4.  
  5. public class Birthday {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         int L = Integer.parseInt(scanner.nextLine());
  9.         int W = Integer.parseInt(scanner.nextLine());
  10.         int H = Integer.parseInt(scanner.nextLine());
  11.         double Percentage = Double.parseDouble(scanner.nextLine());
  12.         double Volume = L * W * H;
  13.         double Litre = Volume * 0.001;
  14.         double UsableVolume = Litre * (1 - (Percentage * 0.01));
  15.         DecimalFormat f = new DecimalFormat("##.000");
  16.         System.out.println(f.format(UsableVolume));
  17.  
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment