- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static final Double SHOE_RATIO = 0.6;
- public static final Double EQUIP_RATIO = 0.8;
- public static final Double BALL_RATIO = 0.25;
- public static final Double ACCESSORIES_RATIO = 0.2;
- public static final Double CHICKEN_PRICE = 10.35;
- public static final Double FISH_PRICE = 12.40;
- public static final Double VEGGIE_PRICE = 8.15;
- public static final Double DELIVERY_PRICE = 2.50;
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- // int chicken = Integer.parseInt(scanner.nextLine());
- // int fish = Integer.parseInt(scanner.nextLine());
- // int veggie = Integer.parseInt(scanner.nextLine());
- //
- // System.out.println( createMenu(chicken,fish,veggie));
- // int yearlyTax = Integer.parseInt(scanner.nextLine());
- //
- // System.out.println(calculateGear(yearlyTax));
- int length = Integer.parseInt(scanner.nextLine());
- int width = Integer.parseInt(scanner.nextLine());
- int height = Integer.parseInt(scanner.nextLine());
- double pct = Double.parseDouble(scanner.nextLine());
- System.out.println(calculateWater(length, width, height, pct));
- }
- private static Double calculateWater (int length, int width, int height, double pct){
- double volumeAquarium = length * width * height;
- double volumeLitres = volumeAquarium * 0.001;
- return volumeLitres - (volumeLitres * (pct / 100));
- }
- private static Double calculateGear(int yearlyTax) {
- double shoePrice = yearlyTax * SHOE_RATIO;
- double equipPrice = shoePrice * EQUIP_RATIO;
- double ballPrice = equipPrice * BALL_RATIO;
- double accessoriesPrice = ballPrice * ACCESSORIES_RATIO;
- return shoePrice + equipPrice + ballPrice + accessoriesPrice + yearlyTax;
- }
- private static Double createMenu(int chickenCount, int fishCount, int veggieCount){
- double chickenCost = chickenCount * CHICKEN_PRICE;
- double fishCost = fishCount * FISH_PRICE;
- double veggieCost = veggieCount * VEGGIE_PRICE;
- double totalCost = chickenCost + fishCost + veggieCost;
- double desert = totalCost * 0.2;
- return totalCost + DELIVERY_PRICE + desert;
- }
- }