Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package L01_FirstStepsInCoding_EXC;
- import java.util.Scanner;
- public class P09_FishTank {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //1. Пресметнем обема на аквариума
- //2. Необходимите литри вода
- //3. Принтираме
- int length = Integer.parseInt(scanner.nextLine());
- int width = Integer.parseInt(scanner.nextLine());
- int height = Integer.parseInt(scanner.nextLine());
- double percent = Double.parseDouble(scanner.nextLine());
- double fishTankVolume = (length * width * height) * 0.001; // (length * width * height) / 1000.0
- double neededLiters = fishTankVolume * ( 1 - percent/100);
- System.out.println(neededLiters);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment