package ru.matevosyan.start;

import java.util.Scanner;

/**
 * Class ConsoleInput implements interface Input.
 * Created on 07.12.2016.
 * @since 1.0
 * @version 1.0
 * @author Matevosyan Vardan
 */

public class ConsoleInput implements Input {

    /**
     * variable scanner for reading user input data.
     */

    private Scanner scanner = new Scanner(System.in);

    /**
     * Override interface Inputs method ask.
     * @param question use for showing messages to user
     * @return user reading data
     */

    @Override
    public String ask(String question) {

        System.out.print(question);
        return scanner.nextLine();

    }
}

@@ -649,11 +649,448 @@
 ;%0A%0A    %7D
+%0A%0A    @Override%0A    public int ask(String question, int%5B%5D range) %7B%0A        int key = Integer.valueOf(this.ask(question));%0A        boolean exist = false;%0A        for (int value : range) %7B%0A            if (value == key) %7B%0A                exist = true;%0A                break;%0A            %7D%0A        %7D%0A%0A        if (exist) %7B%0A            return key;%0A        %7D else %7B%0A            throw new MenuOutException(%22Out of menu range. %22);%0A        %7D%0A    %7D
 %0A%7D%0A

add public int ask(String question, int[] range) to override from Input