package ru.job4j.start;

import java.util.*;

/**.
* This class need for interaction for user
* 
* @author Anton Vasilyuk
* @version 1.0
* @since 0.1
*/

public class ValidateInput extends ConsolInput {

	/**.
	* method for checking answers user, and output error
	* @param question
	* @param ranges
	* @return value
	*/
	public int ask(String question, int[] ranges) {
		boolean invalid = true;
		int value = -1;
		do {
			try {
				value = super.ask(question, ranges);
				invalid = false;
			} catch(MenuOutException moe) {
				System.out.println("Please select key from menu.");
			} catch(NumberFormatException nfe) {
				System.out.println("Please enter validate data again.");
			}
		} while(invalid);
		return value;
	}
}
@@ -44,16 +44,43 @@
 ;%0A%0A/**.%0A
+* Chapter_002%0A* Task 2.7.1%0A
 * This c

add file for chapter_002_2.7.1