Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class FishTank {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int width = Integer.parseInt(scanner.nextLine());
- int height = Integer.parseInt(scanner.nextLine());
- int length = Integer.parseInt(scanner.nextLine());
- double percentToRemove = Double.parseDouble(scanner.nextLine());
- //1л = 1дм3 = 1000sm3
- // 1dm = 10sm
- // 1dm3 = 10sm * 10sm * 10sm = 1000sm3
- int volumeInSm = width * height * length;
- double volumeInLiters = volumeInSm / 1000.0;
- double percentToBeRemoved = volumeInLiters * (percentToRemove/100);
- volumeInLiters = volumeInLiters - percentToBeRemoved;
- System.out.println(volumeInLiters);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement