import static java.lang.Math.floor; public class Format { public float money(int people, float sum){ float result = sum / Float.parseFloat(String.valueOf(people)); return result; } public String ruble(float floatPrice){ int price = (int) (floatPrice * 100); price = price /100 % 100; if (price > 20) price %= 10; else if (price > 5) return "ÑÑблей"; else price %= 10; if (price == 1)return "ÑÑблÑ"; else if (price < 5 && price > 0) return "ÑÑблÑ"; else return "ÑÑблей"; } public String endString(float cash) { String endLine = String.format("ÐаждÑй должен оплаÑиÑÑ %.2f %s", cash, ruble(cash)); return endLine; } }