Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Birthday {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int aquariumLength = Integer.parseInt(scanner.nextLine());
  7. int aquariumWidth = Integer.parseInt(scanner.nextLine());
  8. int aquariumHeight = Integer.parseInt(scanner.nextLine());
  9. double sandPercent = Double.parseDouble(scanner.nextLine());
  10.  
  11.  
  12. int aquariumVolume = aquariumLength * aquariumWidth * aquariumHeight;
  13. double aquariumVolumeInDecimeters = aquariumVolume * 0.001;
  14. double aquariumAttributesVolumeInDecimeters = sandPercent * 0.01;
  15. double result = aquariumVolumeInDecimeters * (1 - aquariumAttributesVolume );
  16.  
  17.  
  18. System.out.printf("% . 3f" , result);
  19.  
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement