public class Calculator { float priceForPerson; String outputCalculate; String rub; void calculate(int persons, float totalPrice) { priceForPerson = totalPrice/persons; } void correctOutput() { if (priceForPerson%10 == 1) { rub = "ÑÑблÑ"; } else if (priceForPerson%10 == 2 && priceForPerson%10 == 3 && priceForPerson%10 == 4){ rub = "ÑÑблÑ"; } else { rub = "ÑÑблей"; } outputCalculate = String.format("%.2f", priceForPerson); System.out.println("ÐаждÑй Ñеловек должен заплаÑиÑÑ Ð¿Ð¾: " + outputCalculate + " " + rub); } }