Question: Write the following program as a Java project with four -java files. The four classes are Book, Booklist Person, and TestBooks (the latter one includes


Write the following program as a Java project with four -java files. The four classes are Book, Booklist Person, and TestBooks (the latter one includes main). Use these names for your classes. Use the provided Person class as is (you do not need to modify it) Book Class: represents a book. Books have a title, author, number of pages, and a publication year (or ycar of last revision if online). The author is an object of class Person (use the class provided). Required items (beyond setting up a properly structured class) 1. A constructor that takes input (in order) of title, author,_number of pages, and publication ycar as a String, a Person, and two ints. The author input parameter must bc a Person object. 2. A getPages method that returns the number of pages in thc book at this time. 3. A toString0 method that returns a String suitable for printing out the key information about the book. You decide the format but it should all be one line when the string is printed. Be sure to include the number of pages in the book as part of the returned string 4. An updateBook method that works with the existing book to change its publication year and number of pages (get new values as parameters) No need to do get and set methods for cach piece of data unless you need them for other required work Booklist Class: used to keep track of some number of books. A book can be on zero, one, or more lists at any time. Each BookList object has a name of the list and knows or calculates the number of books in the list. Be sure Bookist objects can be printed from main. Required items (beyond setting up a properly structured class) 1. A constructor that takes input of a list name and a maximum number of books to be on the list as a String and an int. You can ignore the maximum number of items if you don't need but still allow it to be specified in the constructor call. You can decide how you wish to store the books in the list. it in your program 2. A addBook method that takes as input a Book object and adds it to the list. The input parameter must be a Book object that already exists. You do not need to worry about books that are possibly duplicated in the list. Each one counts as a book on the list. Think of it as keeping track of how many times I have read this book for example. 3. A number OfBooks method that returns as an int the actual number of books currently in the list (not the maximum number possible)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
