Question: Write a java program that performs the following: The following diagram illustrates the classes you will implement in this assignment. Private Book (-) title Type:


![title Type: string (-) authors Type: string [] (-) issue Year Type:](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f45986b75af_73466f4598629eec.jpg)
Write a java program that performs the following: The following diagram illustrates the classes you will implement in this assignment. Private Book (-) title Type: string (-) authors Type: string [] (-) issue Year Type: int (-) pages Type: int (+) Parameterized Constructor (+) Setters (+) Getters (+) toString String Public NormalBook (-) weight Type: int (-) print Type Type: string (+) Parameterized Constructor (+) Getters (+) Setters EBOOK (-) sizeInByte Type: int (-) fileType Type: string (+) Parameterized Constructor (+) Getters (+) Setters You will find in the file Library, which is attached to this assignment, the implementation of the classes. You have to update the content of each class as follows: In Book class: 1. add the author array. 2. add the parametrized constructor of form Book(String title, int issue Year, int pages, String a[]). 3. add a setter for the author array of form setAuthors(String[] arr). 4. add a setter for the author array of form setAuthor(String a, int index). This setter sets the received a in the received index. You have to check if the index is a valid index. 5. add a getter for the author array of form String[] getAuthors(). 6. add a getter for the author array of form String getAuthor(int index). This getter returns the author in the received index. You have to check if the index is valid index. 7. Update the toString method to return the author array too. In NormalBook class: 1. make the class NormalBook a subclass for the Book class. 2. add the parametrized constructor to assign data to the data members of NormalBook and assign data to the parent class data members. 3. the function toString of the base class should be overridden to print the additional information about the weight and print type. In EBook class: 1. make the class EBook a subclass for the Book class. 2. add the parametrized constructor to assign data to the data members of EBook and assign data to the parent class data members. 3. the function toString of the base class should be overridden to print the additional information about the sizeInBytes and fileType. In the main method, do the following: 1. Create an array of Books named book_array of size 3 and ask the user to fill the data for each book 2. Print the content of each object in the book_array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
