Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Book.java Class Write java class for the following UML Book.java - author: String - title: String - numberOfPages: integer -isbn: integer Book() Book( String author,
Book.java Class
Write java class for the following UML
Book.java
- author: String
- title: String
- numberOfPages: integer
-isbn: integer
Book()
Book( String author, String title, Integer numberOfPages, Integer isbn)
+getTitle() :String
+setTitle(:String)
+getAuthor( ):String
+setAuthor(String)
+getNumberofPages( ): int
+setNumberofPages(int )
+getIsbn( ) :int
+setIsbn( int )
+displayBook ( )
Library.java Class
Write a Library.java class. This class can hold upto 20 object of the class Book.
It has two attributes
Book shelves[]; //array of books
int num; //store the current number of books in the shelve
Library () is the default constructor which initializes the array with size 20 book;
Boolen addBook(Book aBook) method which takes a book as input and add it to the last empty place in the array. If the array is full the method should return false, otherwise it returns true.
Print method which displays all the books information of all the books in the shelve array.
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