Question: Java lab. Book #title : String #author : String + Book (String, String) + get Title(): String + getAuthor(): String + toString(): String Audio Book


Java lab.
Book #title : String #author : String + Book (String, String) + get Title(): String + getAuthor(): String + toString(): String Audio Book Written Book - duration : int - narrator: String + AudioBook(String, String, int, String) + get Duration(): int + get Narrator(): String + toString(): String nPages: int + Written Book(String, String, int) + getNPages(): int + toString(): String Printed Book EBook - Size : int + EBook(String, String, int, int) + getSize(): int + print(): Printed Book + toString(): String - ISBN: int - hardcover : boolean + Printed Book(String, String, int, int, boolean) + Printed Book(String, String, int) + getISBN: int + get Cover Type(): String + toString(): String Book class: Attributes: title: the title of the book author: the author of the book Methods: Book(title: String, author: int): constructor getTitle(): this method returns the title of the book getAuthor(): this method returns the author of the book toString(): returns the object's info in this format: Title: title, Author: author' Audio Book class: Attributes: duration: the length of the audio file in minutes narrator: the name of the person reading the book Methods: King Saud University College of Computer and Information Sciences Department of Computer Science CSC113 - Computer Programming II Lab: Inheritance Fall 2020 AudioBook(title: String, author: String, duration: int, narrator: String): constructor getDuration(): this method returns the duration of the audio book getNarrator(): this method returns the name of the narrator toString(): returns the object's info in this format: Title: title, Author: author, Format: Audio, Duration: duration, Narrator: narrator' . Written Book class: Attributes: nPages: the number of pages of the book Methods: WrittenBook(title: String, author: String, nPages: int): constructor getNPages (): this method returns the number of pages of the book toString(): returns the object's info in this format: Title: title, Author: author, Format: Written, number of pages: nPages' . PrintedBook class: Attributes: ISBN: the International Standard Book Number of the book hardcover: true if the book is hardcover, false otherwise Methods: PrintedBook(title: String, author: String, nPages: int, ISBN: int, hardcover: boolean): constructor PrintedBook(title: String, author:String, nPages: int): constructor that initializes ISBN to 0 and hardcover to false getISBN(): this method returns the ISBN of the book getCoverType(): returns a string specifying if the book is hardcover or paperback toString(): returns the object's info in this format: Title: title, Author: author, Format: Written, number of pages: nPages, Printed, ISBN: ISBN, hardcover/paperback' . EBook class: Attributes: size: the size of the ebook in MBS . Methods: EBook(title: String, author: String, nPages: int, size: int): constructor getSize(): this method returns the size of the ebook print(): this method returns the current Ebook as an object of type PrintedBook toString(): returns the object's info in this format: Title: title, Author: author, Format: Written, number of pages: nPages, Ebook, size: sizeMB Exercise: Translate into Java-code the previous classes, and write a main method that tests all the previous functionalities
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
