@@ -0,0 +1,1515 @@
+package com.twu.biblioteca.menu;%0A%0Aimport com.twu.biblioteca.IOUtilities;%0Aimport com.twu.biblioteca.library.Library;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Created by watsonarw on 17/04/15.%0A */%0Apublic class CheckOutMovieItem extends AbstractMenuItem%7B%0A%0A    public static AbstractMenuItem instance = new CheckOutMovieItem();%0A%0A    public static final String CHECK_OUT_INSTRUCTION = %22Which movie below would you like to check out:%5Cn%22;%0A    public static final String SUCCESSFUL_CHECKOUT_MESSAGE = %22Thank you! Enjoy the movie%5Cn%22;%0A    public static final String UNSUCCESSFUL_CHECKOUT_MESSAGE = %22That movie is not available.%5Cn%22;%0A%0A    private CheckOutMovieItem() %7B%0A        super(%22Checkout Movie%22);%0A    %7D%0A%0A    @Override%0A    public void action() %7B%0A        IOUtilities.print(CHECK_OUT_INSTRUCTION +%0A                Library.getInstance().getMovieList());%0A        try %7B%0A            String response = IOUtilities.readLine();%0A            if (movieAvailable(Integer.parseInt(response))) %7B%0A                Library.getInstance().checkoutMovie(Integer.parseInt(response));%0A                IOUtilities.print(SUCCESSFUL_CHECKOUT_MESSAGE);%0A            %7D else %7B%0A                IOUtilities.print(UNSUCCESSFUL_CHECKOUT_MESSAGE);%0A            %7D%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D catch (NumberFormatException e2) %7B%0A%0A        %7D%0A    %7D%0A%0A    private boolean movieAvailable(int movieId) %7B%0A        return Library.getInstance().movieExists(movieId) && !Library.getInstance().isMovieCheckedOut(movieId);%0A    %7D%0A%7D%0A

implement checkout movie menu item