import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int guest = People.peopleCount(); String food; String allFood = ""; double money; double allMoney = 0.00; while (true) { System.out.println("ÐведиÑе блÑдо или ÐавеÑÑиÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð´ÑÑеÑа иÑога"); food = scanner.next(); if (food.equalsIgnoreCase("ÐÐÐÐРШÐТЬ")) { break; } allFood = allFood + "\n " + food; System.out.println("ÐведиÑе ÑÑоимоÑÑÑ Ð±Ð»Ñда"); if (scanner.hasNextDouble()) { money = scanner.nextDouble(); if (money < 0) { System.out.println("ÐÑÑиÑаÑелÑной ÑÐµÐ½Ñ Ð·Ð° блÑдо бÑÑÑ Ð½Ðµ можеÑ, введиÑе положиÑелÑное знаÑение!"); } else { allMoney = allMoney + money; } } else { System.out.println("ÐÑ Ð²Ð²ÐµÐ»Ð¸ не ÑиÑло!"); return; } } System.out.println("ÐобавленнÑе ÑоваÑÑ:" + allFood); String result = Calculator.cutResult(allMoney, guest); String rub = Calculator.rubles(allMoney, guest); System.out.println("ÐаждÑй гоÑÑÑ Ð´Ð¾Ð»Ð¶ÐµÐ½ заплаÑиÑÑ " + result + " " + rub); } }