Question: Read the following code and fill in the blanks: The following is a Java program that allows users to add books to a bookstore. There


Read the following code and fill in the blanks: The following is a Java program that allows users to add books to a bookstore. There are two classes class book and the main class: The class book has the following attributes : (Title, ISBN, and Price). The constructor of this class has the following conditions: - The price should be a positive value. - The ISBN is exactly ten digits. Fill in the blanks to ensure that if the two conditions are not sitisfied, the constructor will throw an exception with the message "Invalid Book Informati In the main method, the user is prompted to enter the book informition. Fill in the blanks to add the required exception handling: - To handle if the user enters a mismatched value and prints the stack trace of this exception. - To handle any exception that may occur during the program execution. class book ( String title; int isbn: int price; book (string title, int isbn, int price) if (price =0 if String.valueof(isbn), length ()!=10) f Information") : 1 this.title = title; this.isbn =1 sbn: this.price = price; System, out, println ("Book Added successfully")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
