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 05:00
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
question
Computers and Technology, 23.06.2019 20:40
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
question
Computers and Technology, 24.06.2019 02:00
How are we able to create photographs differently than 100 years ago? explain your answer in relation to your photograph you selected.
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, 30.10.2020 05:20
question
Chemistry, 30.10.2020 05:20
question
Biology, 30.10.2020 05:20
Questions on the website: 13722362