public class Check { private String checkResult; private double totalPrice; private int personCnt; Check(){ this.checkResult = "ÐобавленнÑе ÑоваÑÑ:\n"; } public void setPersonCnt(int personCnt){ this.personCnt = personCnt; } public void addProduct(String producName, double productPrice) { this.checkResult = this.checkResult + String.format("%s %s\n", producName, Formater.format(productPrice)); this.totalPrice += productPrice; System.out.println(String.format("Ð¢Ð¾Ð²Ð°Ñ ÑÑпеÑно добавлен, вÑего добавлено ÑоваÑов на ÑÑÐ¼Ð¼Ñ %s.", Formater.format(this.totalPrice))); } public void printCheck(){ System.out.println(this.checkResult); System.out.println(String.format("CÑоимоÑÑÑ Ð²ÑÐµÑ ÑоваÑов %s, каждÑй Ñеловек должен заплаÑиÑÑ %s.", Formater.format(this.totalPrice), Formater.format(this.totalPrice/this.personCnt))); } }