Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
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