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 percent = Double.parseDouble(scanner.nextLine());
- int volumeInSm = width * height * length;
- // 10sm = 1dm -> 1dm3 = 10sm ^3 (10sm * 10sm * 10sm = 1000sm)
- // 1dm3 = 1000sm3
- double volumeInLiters = volumeInSm / 1000.0;
- double volumeWithoutPercent = volumeInLiters - (volumeInLiters * percent/100);
- System.out.println(volumeWithoutPercent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement