Question
MUST CREATE OWN LINKEDLIST IMPLEMENTATION(RESPONSE TO COMMENT) I need help with this assignment. must use linked list in java (NOT array) Description: Create a system
MUST CREATE OWN LINKEDLIST IMPLEMENTATION(RESPONSE TO COMMENT) I need help with this assignment. must use linked list in java (NOT array) Description: Create a system for a Library. The system will keep track of the books available at the library. Each book has ISBN Name Flag that indicates if a book is borrowed or available. Boolean. There are two types of users that can access the system: An administrator A user The system should support the following functionalities: Adding a new book Deleting an existing book. Update books information Generating reports about available\borrowed\all books. Query information about a specific book Project output screen: When you first run you program, the screen should output the following initial menu: Please select the user type: 1. Administrator 2. User 1)If the user type is administrator, the system provides the following options: Add a book Delete a book Edit a book information Generate report of the available books Generate report of the borrowed books Generate report of all the books (available and borrowed) (Note: the report should include the book ISBN, title, and availability. Exit option that will return to the initial menu. (while loop). 2)If the user type is user, the system provides the following options: Borrow a book if available // find method View available books // see the available books display method Return a book. // Find information about a specific book: // find Exit option that will return to the initial menu. Loop while After performing a specific operation, the system should allow an option to return to the main menu for the user type. Your system should have three classes: 1. Book 2. Administrator 3. User. The system should use a linked list and files to store the books information. << ive already made the first half i just really need help with user class and main class. >>>
class book{ int ISBN; String name; boolean flag; book link; book(int ISBN, String name, boolean flag, book link){ this.ISBN=ISBN; this.name= name; this.flag=flag; this.link=link; } } class admin{ book addBook(book head,int ISBN,String name,boolean flag, int position){ book newbook= new book(ISBN,name,flag,null); book pervious = head; int count =1; while(count pervious=pervious.link; count++; } newbook.link=pervious.link; pervious.link=newbook; return head;} book deletehead(book head){ book temp=head; head=head.link; temp.link=null; return head;} book deletebook(book head, int position){ if(position==1){ return deletehead(head);} book perivous =head; int count=1; while (count perivous=perivous.link; count++; } perivous.link=perivous.link.link; return head;} boolean EditBook(int ISBN,String name,book head){ book current=head; while(current!=null){ if(ISBN==current.ISBN){ current.name=name; return true; } current=current.link; } return false; }
void displayavaliable(book head){ System.out.println("The avaliable books are: "); book current = head; while (current.link!=null){ if(current.flag==true) System.out.print("Name: "+current.name+" Avalibality: "+current.flag+" ISBN: "+current.ISBN+" "); current=current.link; } } void displayborrowed(book head){ System.out.println("The borrowed books are: "); book current =head; while (current.link!=null){ if(current.flag==false) System.out.print("Name: "+current.name+" Avalibality: "+current.flag+" ISBN: "+current.ISBN+" "); current=current.link; }
} void display(book head){ book current =head; while (current.link!=null){ System.out.print("Name: "+current.name+" Avalibality: "+current.flag+" ISBN: "+current.ISBN+" "); current=current.link; } System.out.print("Name: "+current.name+" Avalibality: "+current.flag+" ISBN: "+current.ISBN+" ");
} }
class user { ??????? }
public static void main(String[] args) { ???????? }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started