Advertisement
veronikaaa86

09. Fish Tank

Oct 31st, 2021
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. package firstSteps;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P09FishTank {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. int length = Integer.parseInt(scanner.nextLine());
  10. int width = Integer.parseInt(scanner.nextLine());
  11. int height = Integer.parseInt(scanner.nextLine());
  12. double percentAcc = Double.parseDouble(scanner.nextLine());
  13.  
  14. int volumeCm = length * width * height;
  15. double volumeLt = volumeCm / 1000.0;
  16. double result = volumeLt - (volumeLt * (percentAcc / 100.0));
  17.  
  18. System.out.println(result);
  19. }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement