plain/bookapp/BookApp.java
public static void main(String[] args) {
        System.out.println("ta arxeia java yparxoyn kai sto github: https://github.com/insanitywholesale/yavvar/tree/master/plain/bookapp");
        System.out.println("####### PROSOXH #######");
        System.out.println("den douleuei h klhsh ths taksinomhshs, thelei doyleia akoma");
        System.out.println("oi algorithmoi yparxoun sthn klash MyUtils alla den xeirizontai thn yparksh null pediwn oute taksinomhsh me ola ta pedia");
        System.out.println("####### PROSOXH #######");
        System.out.println("");
        System.out.println("");

        bookArray[0] = new Book("a", "me", "9605122839", "mypub1", 123, 1999, 13.12);
        bookArray[1] = new Book("b", "me", "9780110002224", "mypub2", 789, 1789, 01.65);
        bookArray[2] = new Book("pro linux system admin", "dennis/james/peter", "9781484220078", "A1press", 1008, 2017, 74.82);
        boolean end = false;
        while (!end) {
            listOptions();
            switch (getUserInt(1, 6)) {
                case 1:
                    //find first non-null spot
                    int insertIndex = -1;
                    for (int i = 0; i < 10; i++) {
                        if (bookArray[i] != null) {
                            insertIndex = i;
                        }
                    }
                    if (insertIndex == -1) {
                        System.out.println("den mporei na ginei eisagwgh vivliou epeidh o xwros apothikeyshs gemise");
                        break;
                    }
                    Book newBook = bookMenu();
                    if (newBook == null) {
                        break;
                    } else {
                        bookArray[insertIndex] = newBook;
                        break;
                    }
                case 2:
                    boolean endField = false;
                    boolean endMethod = false;
                    int searchField;
                    String isbn = "";
                    int year = LocalDate.now().getYear() + 2;
                    int searchMethod;
                    while (!endField) {
                        searchField = searchField();
                        switch (searchField) {
                            case 1:
                                isbn = enterISBN();
                                break;
                            case 2:
                                year = enterYear();
                                break;
                            default:
                                endField = true;
                                break;
                        }
                        while (!endMethod && (searchField == 1 || searchField == 2)) {
                            searchMethod = searchMethod();
                            switch (searchMethod) {
                                case 1:
                                    if (searchField == 1) {
                                        MyUtils.seqSearch(bookArray, isbn);
                                    } else {
                                        MyUtils.seqSearch(bookArray, year);
                                    }
                                    endMethod = true;
                                    endField = true;
                                    break;
                                case 2:
                                    if (searchField == 1) {
                                        MyUtils.binSearch(bookArray, isbn);
                                    } else {
                                        MyUtils.binSearch(bookArray, year);
                                    }
                                    endMethod = true;
                                    endField = true;
                                    break;
                                default:
                                    endMethod = true;
                                    break;
                            }
                        }
                        endMethod = false;
                    }
                    endField = false;
                    break;
                case 3:
                    MyUtils.valueSearch(bookArray);
                    break;
                case 4:
                    boolean endSortField = false;
                    boolean endSortMethod = false;
                    int sortField = 0;
                    int sortMethod;
                    while (!endSortField) {
                        sortField = sortField();
                        sorting = sortField;
                        endSortField = true;
                    }
                    while (!endSortMethod) {
                        sortMethod = sortMethod();
                        switch (sortMethod) {
                            case 1:
                                bookArray = MyUtils.bubbleSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 2:
                                bookArray = MyUtils.insertionSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 3:
                                bookArray = MyUtils.selectionSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 4:
                                bookArray = MyUtils.quickSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 5:
                                bookArray = MyUtils.mergeSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            default:
                                endSortMethod = true;
                                break;
                        }
                    }
                    break;
                case 5:
                    for (int i = 0; i < 9; i++) {
                        if (bookArray[i] != null) {
                            System.out.println(bookArray[i]);
                        }
                    }
                    break;
                case 6:
                    end = true;
                    break;
                default:
                    System.out.println("idk");
                    break;
            }
        }//end main while loop
    }
//possible improvement 2: ability to delete book

possible improvement 2: ability to delete book
possible improvement 2 : ability to delete book
public static void main(String[] args) {
        System.out.println("ta arxeia java yparxoyn kai sto github: https://github.com/insanitywholesale/yavvar/tree/master/plain/bookapp");
        System.out.println("####### PROSOXH #######");
        System.out.println("den douleuei h klhsh ths taksinomhshs, thelei doyleia akoma");
        System.out.println("oi algorithmoi yparxoun sthn klash MyUtils alla den xeirizontai thn yparksh null pediwn oute taksinomhsh me ola ta pedia");
        System.out.println("####### PROSOXH #######");
        System.out.println("");
        System.out.println("");
        bookArray[0] = new Book("a", "me", "9605122839", "mypub1", 123, 1999, 13.12);
        bookArray[1] = new Book("b", "me", "9780110002224", "mypub2", 789, 1789, 01.65);
        bookArray[2] = new Book("pro linux system admin", "dennis/james/peter", "9781484220078", "A1press", 1008, 2017, 74.82);
        boolean end = false;
        while (!end) {
            listOptions();
            switch (getUserInt(1, 6)) {
                case 1:
                    int insertIndex = -1;
                    for (int i = 0; i < 10; i++) {
                        if (bookArray[i] != null) {
                            insertIndex = i;
                        }
                    }
                    if (insertIndex == -1) {
                        System.out.println("den mporei na ginei eisagwgh vivliou epeidh o xwros apothikeyshs gemise");
                        break;
                    }
                    Book newBook = bookMenu();
                    if (newBook == null) {
                        break;
                    } else {
                        bookArray[insertIndex] = newBook;
                        break;
                    }
                case 2:
                    boolean endField = false;
                    boolean endMethod = false;
                    int searchField;
                    String isbn = "";
                    int year = LocalDate.now().getYear() + 2;
                    int searchMethod;
                    while (!endField) {
                        searchField = searchField();
                        switch (searchField) {
                            case 1:
                                isbn = enterISBN();
                                break;
                            case 2:
                                year = enterYear();
                                break;
                            default:
                                endField = true;
                                break;
                        }
                        while (!endMethod && (searchField == 1 || searchField == 2)) {
                            searchMethod = searchMethod();
                            switch (searchMethod) {
                                case 1:
                                    if (searchField == 1) {
                                        MyUtils.seqSearch(bookArray, isbn);
                                    } else {
                                        MyUtils.seqSearch(bookArray, year);
                                    }
                                    endMethod = true;
                                    endField = true;
                                    break;
                                case 2:
                                    if (searchField == 1) {
                                        MyUtils.binSearch(bookArray, isbn);
                                    } else {
                                        MyUtils.binSearch(bookArray, year);
                                    }
                                    endMethod = true;
                                    endField = true;
                                    break;
                                default:
                                    endMethod = true;
                                    break;
                            }
                        }
                        endMethod = false;
                    }
                    endField = false;
                    break;
                case 3:
                    MyUtils.valueSearch(bookArray);
                    break;
                case 4:
                    boolean endSortField = false;
                    boolean endSortMethod = false;
                    int sortField = 0;
                    int sortMethod;
                    while (!endSortField) {
                        sortField = sortField();
                        sorting = sortField;
                        endSortField = true;
                    }
                    while (!endSortMethod) {
                        sortMethod = sortMethod();
                        switch (sortMethod) {
                            case 1:
                                bookArray = MyUtils.bubbleSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 2:
                                bookArray = MyUtils.insertionSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 3:
                                bookArray = MyUtils.selectionSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 4:
                                bookArray = MyUtils.quickSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            case 5:
                                bookArray = MyUtils.mergeSort(bookArray, sorting);
                                endSortMethod = true;
                                break;
                            default:
                                endSortMethod = true;
                                break;
                        }
                    }
                    break;
                case 5:
                    for (int i = 0; i < 9; i++) {
                        if (bookArray[i] != null) {
                            System.out.println(bookArray[i]);
                        }
                    }
                    break;
                case 6:
                    end = true;
                    break;
                default:
                    System.out.println("idk");
                    break;
            }
        }
    }
public static void main ( String [ ] args ) { System . out . println ( "ta arxeia java yparxoyn kai sto github: https://github.com/insanitywholesale/yavvar/tree/master/plain/bookapp" ) ; System . out . println ( "####### PROSOXH #######" ) ; System . out . println ( "den douleuei h klhsh ths taksinomhshs, thelei doyleia akoma" ) ; System . out . println ( "oi algorithmoi yparxoun sthn klash MyUtils alla den xeirizontai thn yparksh null pediwn oute taksinomhsh me ola ta pedia" ) ; System . out . println ( "####### PROSOXH #######" ) ; System . out . println ( "" ) ; System . out . println ( "" ) ; bookArray [ 0 ] = new Book ( "a" , "me" , "9605122839" , "mypub1" , 123 , 1999 , 13.12 ) ; bookArray [ 1 ] = new Book ( "b" , "me" , "9780110002224" , "mypub2" , 789 , 1789 , 01.65 ) ; bookArray [ 2 ] = new Book ( "pro linux system admin" , "dennis/james/peter" , "9781484220078" , "A1press" , 1008 , 2017 , 74.82 ) ; boolean end = false ; while ( ! end ) { listOptions ( ) ; switch ( getUserInt ( 1 , 6 ) ) { case 1 : int insertIndex = - 1 ; for ( int i = 0 ; i < 10 ; i ++ ) { if ( bookArray [ i ] != null ) { insertIndex = i ; } } if ( insertIndex == - 1 ) { System . out . println ( "den mporei na ginei eisagwgh vivliou epeidh o xwros apothikeyshs gemise" ) ; break ; } Book newBook = bookMenu ( ) ; if ( newBook == null ) { break ; } else { bookArray [ insertIndex ] = newBook ; break ; } case 2 : boolean endField = false ; boolean endMethod = false ; int searchField ; String isbn = "" ; int year = LocalDate . now ( ) . getYear ( ) + 2 ; int searchMethod ; while ( ! endField ) { searchField = searchField ( ) ; switch ( searchField ) { case 1 : isbn = enterISBN ( ) ; break ; case 2 : year = enterYear ( ) ; break ; default : endField = true ; break ; } while ( ! endMethod && ( searchField == 1 || searchField == 2 ) ) { searchMethod = searchMethod ( ) ; switch ( searchMethod ) { case 1 : if ( searchField == 1 ) { MyUtils . seqSearch ( bookArray , isbn ) ; } else { MyUtils . seqSearch ( bookArray , year ) ; } endMethod = true ; endField = true ; break ; case 2 : if ( searchField == 1 ) { MyUtils . binSearch ( bookArray , isbn ) ; } else { MyUtils . binSearch ( bookArray , year ) ; } endMethod = true ; endField = true ; break ; default : endMethod = true ; break ; } } endMethod = false ; } endField = false ; break ; case 3 : MyUtils . valueSearch ( bookArray ) ; break ; case 4 : boolean endSortField = false ; boolean endSortMethod = false ; int sortField = 0 ; int sortMethod ; while ( ! endSortField ) { sortField = sortField ( ) ; sorting = sortField ; endSortField = true ; } while ( ! endSortMethod ) { sortMethod = sortMethod ( ) ; switch ( sortMethod ) { case 1 : bookArray = MyUtils . bubbleSort ( bookArray , sorting ) ; endSortMethod = true ; break ; case 2 : bookArray = MyUtils . insertionSort ( bookArray , sorting ) ; endSortMethod = true ; break ; case 3 : bookArray = MyUtils . selectionSort ( bookArray , sorting ) ; endSortMethod = true ; break ; case 4 : bookArray = MyUtils . quickSort ( bookArray , sorting ) ; endSortMethod = true ; break ; case 5 : bookArray = MyUtils . mergeSort ( bookArray , sorting ) ; endSortMethod = true ; break ; default : endSortMethod = true ; break ; } } break ; case 5 : for ( int i = 0 ; i < 9 ; i ++ ) { if ( bookArray [ i ] != null ) { System . out . println ( bookArray [ i ] ) ; } } break ; case 6 : end = true ; break ; default : System . out . println ( "idk" ) ; break ; } } }
possible improvement 2: ability to delete book
possible improvement 2 : ability to delete book
//find first non-null spot
 //end main while loop
