public class Checking { public static boolean isInt(String input) { if (input == null || input.isEmpty()) { System.out.println("ÐÑÐ»ÐµÐ²Ð°Ñ ÑÑÑока! ÐведиÑе ÑиÑловое знаÑение:"); return false; } try { Integer.parseInt(input); return true; } catch (NumberFormatException e) { System.out.println("Ðолжно бÑÑÑ Ñказано ÑиÑловое знаÑение! ÐожалÑйÑÑа повÑоÑиÑе ввод:"); } return false; } public static boolean isNotEmpty(String input) { if (input == null || input.isEmpty()) { System.out.print("ÐÑÐ»ÐµÐ²Ð°Ñ ÑÑÑока! "); return false; } return true; } public static boolean isDouble(String input) { if (input == null || input.isEmpty()) { System.out.print("ÐÑÐ»ÐµÐ²Ð°Ñ ÑÑÑока! "); return false; } try { Double.parseDouble(input); if (input.indexOf('.') != -1) { String[] splitter = input.split("\\."); if (splitter[1].length() > 2) { System.out.print("ÐолиÑеÑÑво копеек не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð±Ð¾Ð»ÑÑе 100! "); return false; } else { return true; } } else { return true; } } catch (NumberFormatException e) { System.out.print("Ðолжно бÑÑÑ Ñказано ÑиÑловое знаÑение! "); } catch (ArrayIndexOutOfBoundsException e) { System.out.print("ФоÑÐ¼Ð°Ñ Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ð¾Ð¹ ÑÑоимоÑÑи не ÑооÑвеÑÑÑвÑÐµÑ 'ÑÑбли.копейки'! "); } return false; } }