package com.company; import java.util.Scanner; public class TravelAgency { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String town = scanner.nextLine(); String packet = scanner.nextLine(); String card = scanner.nextLine(); int countDays = Integer.parseInt(scanner.nextLine()); double price = 0; if ("Bansko".equals(town) || "Borovets".equals(town)) { if (packet.equals("withEquipment")) { price = 100; } else if (packet.equals("noEquipment")) { price = 80; } } else if ("Varna".equals(town) || "Burgas".equals(town)) { if (packet.equals("withBreakfast")) { price = 130; } else if (packet.equals("noBreakfast")) { price = 100; } } if (card.equals("yes")) { if (packet.equals("withEquipment")) { price = 100 - 100 * 0.01; } else if (packet.equals("noEquipment")) { price = 80 - 80 * 0.05; } else if (packet.equals("withBreakfast")) { price = 130 - 130 * 0.12; } else if (packet.equals("noBreakfast")) { price = 100 - 100 * 0.07; } } if (countDays > 7) { countDays = countDays - 1; } price = countDays * price; if ("Bansko".equals(town) || "Borovets".equals(town) || "Varna".equals(town) || "Burgas".equals(town)) { if (packet.equals("withEquipment") || packet.equals("noEquipment") || packet.equals("withBreakfast") || packet.equals("noBreakfast")) { if (countDays > 1) { System.out.printf("The price is %.2flv! Have a nice time!", price); } } } else if (countDays < 1) { System.out.println("Days must be positive number!"); } else { System.out.println("Invalid input!"); } } }