Question: JAVA Al Hashim Library has created a new module for Issuing books based on various condition which will increase the habit of reading and frequent

JAVA
JAVA Al Hashim Library has created a new module for Issuing books

Al Hashim Library has created a new module for Issuing books based on various condition which will increase the habit of reading and frequent visits to the library. They wish to issue only 2 books at a time. Members may not take more or less books. Based on this scenario develop a Java program with few hints given below, a) An interface named Library with the following members: Member Variable: issueqty I/ a constant value =2 Method Members: issueBook() I/abstract method which will decrease book quantity by 2(use member variable) Display a message "Cannot Issue" if bookQty=0. qtyBook() I/an abstract method to return the quantity of books. retumBook() I/abstract method which will increase book quantity by 2 (use member variable) b) A class named Books that implements the interface with the following members: Member variables: bookld I/Book ID bookName I/Book Name bookQty // quantity of books Constructor: to set the values of the member variables. Member Methods: issueBook() //implement the method to decrease book quantity by 2. Display a message "Cannot Issue" if bookQty=0 qtyBook() I/ implement the method to return the total quantity of books. retumBook() // implement the method to increase book quantity by 2. displayDetails( ) I/ to display Book ID, Book Name, Book Quantity c) In the main method do the following: - Create objects of the class using following input and display all the details: StaffMember ("FIC103", "Time Machine", 0) Call methods to, - Issue books. - Return books - Display Details. d) To run and print the required output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!