public class Book { private Author author; private String title, genre; private int numPages, yearPublished; //no-arg public Book() { author = new Author(); title = "The Stand"; genre = "horror"; numPages = 823; yearPublished = 1978; } //receive all data fields for the author and book public Book(String name, int numBooks, int yearBorn, String t, String g, int numPages, int yearPublished) { author = new Author(name, numBooks, yearBorn); title = t; genre = g; this.numPages = numPages; this.yearPublished = yearPublished; } //receive an Author object and book data fields public Book(Author a, String t, String g, int n, int y) { this.author = a; title = t; genre = g; numPages = n; yearPublished = y; } public String toString() { return title + " by " + author.getName() + ", published in " + yearPublished +" and is " + numPages + " pages in length"; } public Book compare(Book b) { if(numPages> b.getNumPages()) return this; else return b; } public Author getAuthor() { return author; } public void setAuthor(Author author) { this.author = author; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getGenre() { return genre; } public void setGenre(String genre) { this.genre = genre; } public int getNumPages() { return numPages; } public void setNumPages(int numPages) { this.numPages = numPages; } public int getYearPublished() { return yearPublished; } public void setYearPublished(int yearPublished) { this.yearPublished = yearPublished; } }