Question: In Java, I have a code that needs a couple changes. ASAP, I need to get it within the next 3 0 minutes, so please

In Java, I have a code that needs a couple changes. ASAP, I need to get it within the next 30 minutes, so please just help as much as you can fast and Ill give you an upvote!
So basically, we have a code that reads from an input file. Theres a tab between each word and 5 different sections. I got the code working, and I got the exceptions all written, but I have two things that won't work. I'll address what they are and then provide the code needed to be repaired.
The code takes an input from the user of a ID and then prints various things.
1. I have a class set up for the exception, but I do not have the BookSearch class setup to throw the "BookIdAlreadyExistException" so I need it to throw that when the user enters an ID that is found in multiple books (it is the first part of the array)
2. I need the code to print out a # of total books and print out all the titles of the books after the user puts in the input. Right now it just loops and asks for another input.
I was able to get the code to print out the list of books before the input, but thats not what I need, if it helps heres the small section for that
int count=0;
for(int i=0;i booksOut = new ArrayList();
while (reader.hasNextLine()){
String bookRaw = reader.nextLine();
String[] bookPro = bookRaw.split("\\s+");
Book newBook = new Book(bookPro[0], bookPro[1], bookPro[2], bookPro[3], bookPro[4]);
booksOut.add(newBook);
try{
Book.bookSearch(booksOut, booksOut.size(), newBook.getId());
} catch (BookNotFoundException e){
System.out.println("
"+ e.getMessage());
}
int count=0;
for(int i=0;i

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 Programming Questions!