package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by watsonarw on 16/04/15.
 */
public class MainMenu {

    public static MainMenu instance = new MainMenu();

    private MainMenu(){ }

    public void show() {
        System.out.print("------ Main Menu ------\n" +
                           "Select an option below:\n" +
                           " 1 | List Books\n");
    }

    public void handleResponse() {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int response = br.read();
            System.out.print(BibliotecaApp.getLibrary().getBookList());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

@@ -241,16 +241,132 @@
 enu();%0A%0A
+    public static final String INVALID_INPUT_MESSAGE = %22The input you've entered is invalid, please try again.%5Cn%22;%0A%0A
     priv
@@ -720,19 +720,22 @@
         
+Str
 in
-t
+g
  respons
@@ -749,148 +749,458 @@
 read
-();%0A            System.out.print(BibliotecaApp.getLibrary().getBookList());%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace(
+Line();%0A            switch (Integer.parseInt(response)) %7B%0A                case 1:%0A                    System.out.print(BibliotecaApp.getLibrary().getBookList());%0A                    break;%0A                default:%0A                    System.out.print(INVALID_INPUT_MESSAGE);%0A            %7D%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D catch (NumberFormatException e) %7B%0A            System.out.print(INVALID_INPUT_MESSAGE
 );%0A 

Implement invalid input message when input is invalid