package ru.job4j.tracker.ui;

import ru.job4j.tracker.controller.Input;

import java.util.Scanner;

/**
 * This class is implementation of interface input.
 *
 * @author Kucykh Vasily (mailto:basil135@mail.ru)
 * @version $Id$
 * @since 13.04.2017
 */
public class ConsoleInput implements Input {

    /**
     * this scanner is is scanner.
     */
    private Scanner scanner = new Scanner(System.in);

    /**
     * method ask a user about what to do next.
     *
     * @param question is question about what to do next
     * @return String that we input
     */
    @Override
    public String ask(String question) {

        System.out.println(question);

        return scanner.nextLine();

    }

}

@@ -64,16 +64,77 @@
 r.Input;
+%0Aimport ru.job4j.tracker.exceptions.IndexOutOfRangeException;
 %0A%0Aimport
@@ -383,19 +383,16 @@
 nner is 
-is 
 scanner.
@@ -757,10 +757,490 @@
 %0A    %7D%0A%0A
+    @Override%0A    public int ask(String question, int%5B%5D range) throws IndexOutOfRangeException %7B%0A%0A        boolean exist = false;%0A%0A        int key = Integer.valueOf(ask(question));%0A%0A        for (int value : range) %7B%0A%0A            if (value == key) %7B%0A                exist = true;%0A                break;%0A            %7D%0A%0A        %7D%0A%0A        if (exist) %7B%0A            return key;%0A        %7D else %7B%0A            throw new IndexOutOfRangeException(%22Incorrect menu action.%22);%0A        %7D%0A%0A    %7D%0A%0A
 %7D
-%0A

Refactor ConsoleInput.java