Question: 1 0 . Consider the code snippet below. You have to write a program that models a library with books. Each book has a unique
Consider the code snippet below. You have to write a program that models a library with books. Each book has a unique identification number, title, and author. The identification number is autogenerated and autoincremented for each book added to the library's catalog. The library's name and address are fixed for all books. Marks For example: If two books, To Kill a Mockingbird" by Harper Lee and by George Orwell are added, the output should be:Library Name: Central LibraryLibrary Address: Main StBook ID: Book Title: To Kill a MockingbirdBook Author: Harper Lee Library Name: Central LibraryLibrary Address: Main StBook ID: Book Title: Book Author: George Orwell To assist with the task, a Book class and a Library class with a main method are given in the program. You have to fill the missing code in each class and method.A Book class This class should have static and final variables for book counter, library name, and library address. It should also have a constructor that takes the title and author as arguments and autogenerates the identification number.B displayBookDetails This method should display the library name, library address, book ID book title, and book author in the given format. Java code:class Book MISSING CODE A private int id; private String title; private String author; public BookString title, String author this.title title; this.author author; MISSING CODE B public void displayBookDetailsMISSING CODE C public class Library public static void mainString args Book book new BookTo Kill a Mockingbird", "Harper Lee"; bookdisplayBookDetails; Book book new Book "George Orwell"; bookdisplayBookDetails;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
