Question: i need help fixing my code. i keep getting invalid input when i try to run it Leraryspemiase X java, 10, Fale; Exert jav.wtiL.Coluections: capors

i need help fixing my code. i keep getting invalid input when i try to run it
i need help fixing my code. i keep getting invalid input when
i try to run it Leraryspemiase X java, 10, Fale; Exert jav.wtiL.Coluections:
capors jave.util.Linked ist: ancers jova.utit.Listiterator; putuc static vold asini(string fI args) 1
tri1 1) ingut tatenane as the arounent Scatner sen= acy Scaner(file) sering
onctines int count = os thile (scan, RastextLine(1) 4 i) sepe record

Leraryspemiase X java, 10, Fale; Exert jav.wtiL.Coluections: capors jave.util.Linked ist: ancers jova.utit.Listiterator; putuc static vold asini(string fI args) 1 tri1 1) ingut tatenane as the arounent Scatner sen= acy Scaner(file) sering onctines int count = os thile (scan, RastextLine(1) 4 i) sepe record cheline = scan, RextLine()) 0 splys atteitites 1) prent we coch ene tertgirlog 8 i itens) Gystes owt,printin(o): ) icen,ctose (1): o.printsteckreceli) 1 ) Chile (iteraterohaldext()) 1 itcrater,prevedis) 3 3 Lbrary-adast (nemeoolu; ter (gosk book z tibrary) i If (book-outhor.equats(author) \& book, titic.equals(title)) i return trues: ) 3 ) return fatseg putuc Book setbookfstring outhor, string title) if for (look book : Wharin) ? If (cook-auther-equats(auther) es book.titte.equals(title)) \& , reture book; 3 3) retorn notts for (took book: tibrem i returns 3 3 3. Listiterotoresolo iterator = Iibrary, tistiterater(): white (atoretor, hewlext (I) if iterator, resevelis; 3 3. y returin. butife voit printelerengs ) ) ( book ; Ubrary) ? \} ) . . out,printin(book, tostring() * "in"); pustuc oowsie getrating (String auther, String titie) f for (bog book : tibrary) \& If (book, outhor.equats(avthor) s6 book,titte, equats(titte)) \& retorn book. aversting: \} 3 publyc int gethumpges(string author, String title) ( for tooc book : librany) ? if (book. author.equals(outhor) \&s book.title-equats(tutie)) ( ) (book, author. equalsi return boek. numpages; 3 return -1: // Meturn -1 if the bouk is not found pubtic volo searchayportialyatch(string keyward) if tor (book book i libran) i Systen.eut.printin(book.tostringli) * " n3 ), ) 1 J Hinfedistecols searchesutt = nev LinkedListo (ubrary) ) Printrophidokstsearchinosult, 10), Bublic void reconsengtopleghingage () \& ) int count os tor coon took t beoks) \& private void printTopNDooks (CinkedLis books, int n) f int count =0; for (Book book : books) \& Systes, out, print in(book, tostring() +"(nn) : count+t; if (count =n ) t \} break; \} I/ Method to toad the araloatad gataset tron a CSV tile private void loadbataset(string filedsane) f try 1 Scanner sean= new Scanner(file); wile (scan, hasvextLine()) \& String oneline = scan.nextLine(); String [] items = oneline, sptit("," "); II Assuning the CSV format is: Title, Author, ISBN, Shelflocation, NunPages, AvgRating if (itens, length =6 ) f String title =1 tems (0)trin() : String author = itens [i], trint); String isay = 1tens [2]. trin(): String sheiflocation =1 tems [3]trin() : int numpages = Integer.parseInt (itens (d). trin()); double avgRating = Doubte,parse.ouble(itens [5], trim()); Book newook = new Book(title, author, Isaw, shelfLocation, numPages, avgRating); addbook (nevoook); 3 else ? Systen, out,printin("Invatid record in the dataset: " + oneLine): \} ) sean, close( ): 3catch( Exception ex) 1 1 j ex.printstackirace (); public static void main (5tring [] args) \{ Library5ysten tibrary5ysten = new Library5ysten(), scanner skanoser, = new Scanner(Systen, in); CL Load aseloaded datasst from "Books. csv" Librarysystem, toadoataset ("/Osers/breannajohnson/Downtoads/CSC-2217_books_Dataset, csy") : public static void moin(stringl) args) 1 Libransysten librarySysten = new Librarysysten(); scapner scameer a new Scanner(Systen, in); UbrarySysten. LoesDotaset("/Users/breanajohnson/Down loads/CSC-2217_Books_Dotaset.csv"); while (true) t 5ybten, eut, println(ELibrary Systen Meru: "): Systez.out.print in ("1. Add a Book"); Syites, eut.printin( "2. Check if a deok is in the Library"); Systen, out,printin ("3. Retrieve Information on a Book"); Systen,ovt, printin("4. Retrieve Informstion on Systes. out.printin (-5. Delete a Book"); 5ysten. out, printin(-5. Driat Library Contents"); Systen, oot, printin ( 7 . Query Boting of a Dook"); Systes.out, printin("8. Query Number of Pages of a Book"); Syaten.ovt. printin (-9. Search by Partiat Matech"); 5ystes,out. print in ("10. Recommend Top 10 Books by Rating"), Syatco, out, printin ("12. Reload Pretoaded ostaset"); Systes, out. print ("Enter your cholce: "); lat choice = scanner. nextint (); scarner.nextifine (): switch (choice) f case it (II... (existing cases) case 13: Break 11.... (existion coses) cose 14t deroult: )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!