subject

SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied.
In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit.

The following Book class is used to represent books and print information about each book. Each Book object has attributes for the book title and for the name of the book’s author.

public class Book
{
private String title;
private String author;

public Book(String t, String a)
{
title = t;
author = a;
}

public void printBookInfo()
{
System. out. print(title + ", written by " + author);
}
}
(a) The PictureBook class is a subclass of the Book class that has one additional attribute: a String variable named illustrator that is used to represent the name of the illustrator of a picture book. The PictureBook class also contains a printBookInfo method to print the title, writer, and illustrator of a picture book.

Consider the following code segment.

PictureBook myBook = new PictureBook("Peter and Wendy", "J. M. Barrie",
"F. D. Bedford");
myBook. printBookInfo();
The code segment is intended to print the following output.

Peter and Wendy, written by J. M. Barrie and illustrated by F. D. Bedford
Complete the PictureBook class below. Your implementation should conform to the example above.

public class PictureBook extends Book

Question 2
Consider the following books.

A book titled Frankenstein, written by Mary Shelley
A picture book titled The Wonderful Wizard of Oz, written by L. Frank Baum and illustrated by W. W. Denslow
The following code segment is intended to represent the two books described above as objects book1 and book2, respectively, and add them to the ArrayList myLibrary.

ArrayList myLibrary = new ArrayList();
/* missing code */
myLibrary. add(book1);
myLibrary. add(book2);
(b) Write a code segment that can be used to replace /* missing code */ so that book1 and book2 will be correctly created and added to myLibrary. Assume that class PictureBook works as intended, regardless of what you wrote in part (a).

Question 3
The BookListing class is used to generate a descriptive listing for a book. The BookListing constructor takes a Book object and a double value as parameters and uses them to print information about the book, along with its price.

Assume that book1 and book2 were created as specified in part (b). The following table demonstrates the intended behavior of the BookListing class using objects book1 and book2.

Code SegmentResult Printed
BookListing listing1 = new BookListing(book1, 10.99);
listing1.printDescription();Franken stein, written by Mary Shelley, $10.99
BookListing listing2 = new BookListing(book2, 12.99);
listing2.printDescription();The Wonderful Wizard of Oz, written by L. Frank Baum and illustrated by W. W. Denslow, $12.99
(c) Complete the BookListing class below. Your implementation should conform to the examples. Assume that class PictureBook works as intended, regardless of what you wrote in part (a).

public class BookListing

CAN ANYONE PLEASE PROVIDE THE COLLEGEBOARD AP CLASSROOM FILES FOR THE SOLUTIONS TO THIS FRQ? THIS IS AP COMPUTER SCIENCE A UNIT 9 FRQ ON AP CLASSROOM.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
question
Computers and Technology, 23.06.2019 10:00
How do i delete my account on this because i didn't read this agreements and also i put age at xd
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
Which steps will open the system so that you can enter a question and do a search for
Answers: 1
You know the right answer?
SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the clas...
Questions
question
Mathematics, 04.02.2020 13:58
question
Mathematics, 04.02.2020 13:58
question
Mathematics, 04.02.2020 13:58
Questions on the website: 13722367