Debugging Exercise 9-1 DInstructions DebugNine1.java Looks up author of selected
ID: 3755790 • Letter: D
Question
Debugging Exercise 9-1 DInstructions DebugNine1.java Looks up author of selected books 2 import java.util. 3 class DebugNine1 The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly 5 public static void main(String[] args) Scanner input new Scanner (Systen. in): String[][] books = new String[6][2]; books[0jre"Ulysses" books [0][1]"Janes Joyce books[1]8]"Lolita" books[1]1]"Vladinir Nabokov" books [2]1e]"Huckleberry Finn books[2][1] "ark Twatn books[3]"Great Gatsby" books[3]1]F. Scott Fitzgerald" books[4]0e]"1984 books[4101] George Orwell" books [51]"Sound and the Fury books [5][1] "William Faulkner" Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade. 10 Once you are happy with your results, click the Submit button to record your score. 14 15 16 18 21 String entry, shortEntry 23 message-"Enter the first three characters of a book title "+" ontt1ng "A" or "The" 24 25 26 27 28 29 30 31 32 int nun, x boolean isFound = true while(!isFound) System.out.println(essage): entry-1nput.next) shortEntry-entry.substring(.3): for(x-: xExplanation / Answer
The programm is working fine with out any errors and logical errors
so here we starting the loop untill we found the book in the array..
we are checking it the books[1][0] starts with the given letters than printing the book name and author name and breaking the loop to come out of the loop and making variables isFound as true so that while loop exists
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.