Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P08FishTank {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int lengthCm = Integer.parseInt(scanner.nextLine());
- int widthCm = Integer.parseInt(scanner.nextLine());
- int heightCm = Integer.parseInt(scanner.nextLine());
- double initPercent = Double.parseDouble(scanner.nextLine());
- double volumeCm = lengthCm * widthCm * heightCm;
- double volumeLt = volumeCm * 0.001;
- double percent = initPercent * 0.01;
- double result = volumeLt - (volumeLt * percent);
- System.out.printf("%.2f", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement