public class Product { public double price; public String name; public Product(double price, String name) { this.price = price; this.name = name; } public static void calculation(int persons, double total) { String text = "ÐÑого ÑÑÐµÑ Ð½Ð° одного Ñеловека бÑÐ´ÐµÑ %.2f %s"; double result = total / persons; String rub = "ÑÑблÑ"; if (Math.floor(result) >= 5 ) { rub = "ÑÑблей"; } else if (Math.floor(result) < 5 && Math.floor(result) > 1){ rub = "ÑÑблÑ"; } text = String.format(text, result,rub); System.out.println(text); } }