Advertisement
veronikaaa86

08. Fish Tank

Jun 7th, 2021
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P08FishTank {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int lengthCm = Integer.parseInt(scanner.nextLine());
  8. int widthCm = Integer.parseInt(scanner.nextLine());
  9. int heightCm = Integer.parseInt(scanner.nextLine());
  10. double initPercent = Double.parseDouble(scanner.nextLine());
  11.  
  12. double volumeCm = lengthCm * widthCm * heightCm;
  13. double volumeLt = volumeCm * 0.001;
  14. double percent = initPercent * 0.01;
  15. double result = volumeLt - (volumeLt * percent);
  16.  
  17. System.out.printf("%.2f", result);
  18. }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement