Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a simplistic library system consisting of ( only ) books and magazines. Objects in your system: Book: Has a title of type String Has
Create a simplistic library system consisting of only books and magazines. Objects
in your system:
Book:
Has a title of type String
Has an author of type String
Has a publisher of type String
Magazine:
Has a title of type String
Has a publisher of type String
Has a print date of type LocalDate
Library:
Has a main method
Creates three published works:
A book of title "Crime and Punishment" with author "Dostoevsky" and
publisher of "Simon and Schuster"
A magazine of title "Sports Illustrated" with publisher "Random House" and
print date of
A book of title "The Hobbit" with author "Tolkien" and publisher "Harper
Collins"
Has a method named printCollection that will print any number of published
works using a toString method that includes the class name by using
"this.getClass See lesson videos for an example.
Your solution:
Must be formatted with extra empty lines removed and proper indentation. Use
CTRLSHIFTF or Mac equivalent
Must leverage inheritance
Must match the following output exactly when executed with the test published
works as stated above PLEASE MAKE THE EXACT EXECUTION HERE BELOW!:
class lib.Book: titleCrime and Punishment,publisherSimon and Schuster
class lib.Book: titleThe Hobbit,publisherHarper Collins
class lib.Magazine: titleSports Illustrated,publisherRandom House
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started