deyanivanov966

08. Fish Tank

Aug 21st, 2020 (edited)
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class FishTank {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         double Length = Double.parseDouble(scanner.nextLine());
  10.         double Width = Double.parseDouble(scanner.nextLine());
  11.         double Height = Double.parseDouble(scanner.nextLine());
  12.         double Percentage = Double.parseDouble(scanner.nextLine());
  13.  
  14.         double Volume = Length * Width * Height;
  15.         double TotalLitres = Volume *  0.001;
  16.         double Percentage1 = Percentage * 0.01;
  17.  
  18.         System.out.printf("%.2f", TotalLitres * (1 - Percentage1));
  19.  
  20.     }
  21. }
Add Comment
Please, Sign In to add comment