Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Implementation of a File containing the record structure for Books Title, Aut

ID: 3535298 • Letter: 1

Question

1. Implementation of a File containing the record structure for Books Title, Author

2. Implementation of READ FILE code, that executes whenever user requests a LIST of Books. The Books read are stored in an ArrayList structure in memory.

3. Implementation of WRITE FILE code, that executes whenever user requests to ADD a Book.

4. Implementation of a SORT Method in the Library Class, that sorts the Book List alphabetically by title.

5. Implementation of a REMOVE Method in the Library Class that removes a Book from the file.

6. It needs to read ALL the books from the file, loop through the ArrayList to find the textbook to be removed. Remove the textbook and WRITE the ArrayList of books back to File.

7. Create a Fiction and Nonfiction class that inherits Book. Look for the “Super†invocation in different parts of the code. Also, look at the implementation of type casting in the client class.

8. Implementation of a GUI Radio Buttons interface added to the Client Class. Implement a response to these buttons by adding the classes fiction and nonfiction to the Library Class.

9. This part of the Library program will keep track of Library users and the books they checked out and checked in.

10. As part of this implementation, you need to create a User class that has the following:

Instance variables (private variables in the class)

Array of books checked out

Methods Implementation

Login

Check_Out

Check_In

List_User_Books - Outputs a list of All books in the user’s Array of books checked out.

toString -- Outputs a list of ALL (private vars) the information pertaining to this user.

This is effectively a fairly primitive code implementation.. I have much of the UI already built, but of all this it needs the ability to reference and pass information to write to and the like with ArrayList to the text files. I will give full points to someone who can parse the code chunks as mentioned here.

Explanation / Answer

public class BookManager {

private static final int Max = 1000;

private static Book[]bookList= new Book[Max];

public static void addBook (Book i){

int NumBooks = Book.GetNumBooks();


bookList[NumBooks - 1] = i;

int lo = 0;


int hi = NumBooks - 1;


for (int j = lo + 1;j<=hi;j++){


Book hold = bookList [j];


int k = j-1;



while( k >=0 && hold.isbn.compareToIgnoreCase(bookList[k].isbn)<0){


bookList[k + 1] = bookList[k];


--k;


}


bookList[k+1] = hold;


}//end for



}//end addBook


}


public class Book{


public static int NumBooks=0;

public String isbn;

private char type;

private String status;

private String author;

private String publisher;

private String dateBorrowed;

private String title;

public Book (String i,String t, char ty, String s, String a, String p,String d){

isbn=i;

title=t;

type=ty;

status=s;

author=a;

publisher=p;

dateBorrowed=d;

}

public String GetIsbn(){

return isbn;

}

public char GetType(){

return type;

}

public String GetStatus(){

return status;

}

public String GetAuthor()

return author;

}

public String GetPublisher(){

return publisher;

}


public String GetdateBorrowed(){

return dateBorrowed;

}

public String GetTitle(){

return title;

}

public int GetNumBooks(){

return NumBooks;

}

public void setNumBooks(int NumBooks){

NumBooks--;

} }