Test4
and save your class in a file named
Test4.java
.
submit 1020 Test4 Test4.javaYou may submit your solution more than once. Additional documentation about the
submit
command can be viewed by typing
man submit
.
Library
represents a library. A library contains
a collection of books. A book is represented by the abstract class
Book
. We only consider two types of books: novels and picture
books. These are represented by the classes Novel
and
PictureBook
. All these classes are part of the package
labtest4for1020
. For more details
of these classes, see the API.
To work from home, download
this jar file and place it in the same folder as type.jar.
Library
object.
Next, print a text-based representation of the books in the created library.
Hint: see API of Library
.
Here is a sample run:
Fox, written by Margaret Wild and illustrated by Ron Brooks To Market, To Market, written by Anne Miranda and illustrated by Janet Stevens First Day, written by Margaret Wild and illustrated by Kim Gamble Between You and Me, written by Mike Wallace The Year of Magical Thinking, written by Joan Didion A Man without a Country, written by Kurt Vonnegut Baby Boomsticks, written by Margaret Wild and illustrated by David Legge The Bilbies of Bliss, written by Margaret Wild and illustrated by Noela Young The Tender Bar, written by J. R. MoehringerHere is another sample run:
labtest4for1020.CreationException: Creation failed: creation of picture book failedIn this second sample run, the creation of the library failed. Hint: see API of
Library
.
Here is a sample run:
Fox, written by Margaret Wild and illustrated by Ron Brooks To Market, To Market, written by Anne Miranda and illustrated by Janet Stevens First Day, written by Margaret Wild and illustrated by Kim Gamble Between You and Me, written by Mike Wallace The Year of Magical Thinking, written by Joan Didion A Man without a Country, written by Kurt Vonnegut Baby Boomsticks, written by Margaret Wild and illustrated by David Legge The Bilbies of Bliss, written by Margaret Wild and illustrated by Noela Young The Tender Bar, written by J. R. Moehringer This library contains 4 novels and 5 picture booksHere is another sample run:
labtest4for1020.CreationException: Creation failed: creation of picture book failed
PictureBook
.
Here is a sample run:
Fox, written by Margaret Wild and illustrated by Ron Brooks To Market, To Market, written by Anne Miranda and illustrated by Janet Stevens First Day, written by Margaret Wild and illustrated by Kim Gamble Between You and Me, written by Mike Wallace The Year of Magical Thinking, written by Joan Didion A Man without a Country, written by Kurt Vonnegut Baby Boomsticks, written by Margaret Wild and illustrated by David Legge The Bilbies of Bliss, written by Margaret Wild and illustrated by Noela Young The Tender Bar, written by J. R. Moehringer This library contains 4 novels and 5 picture books Ron Brooks Janet Stevens Kim Gamble David Legge Noela YoungHere is another sample run:
labtest4for1020.CreationException: Creation failed: creation of picture book failed
Here is a sample run:
Fox, written by Margaret Wild and illustrated by Ron Brooks To Market, To Market, written by Anne Miranda and illustrated by Janet Stevens First Day, written by Margaret Wild and illustrated by Kim Gamble Between You and Me, written by Mike Wallace The Year of Magical Thinking, written by Joan Didion A Man without a Country, written by Kurt Vonnegut Baby Boomsticks, written by Margaret Wild and illustrated by David Legge The Bilbies of Bliss, written by Margaret Wild and illustrated by Noela Young The Tender Bar, written by J. R. Moehringer This library contains 4 novels and 5 picture books Ron Brooks Janet Stevens Kim Gamble David Legge Noela Young