Question: create the following classes and a main program for a simple library management system: LibraryItem Class: Attributes: title ( String ) , creator ( String
create the following classes and a main program for a simple library management system:
LibraryItem Class:
Attributes: title String creator String itemId int available boolean
Methods: checkoutItem returnItemisAvailablegetItemId toStringoptional
Book Class extends LibraryItem:
Attributes: genre String numberOfPages int
Constructor: BookString title, String creator, int itemId, String genre, int numberOfPages
Method: toStringoptional
DVD Class extends LibraryItem:
Attributes: director String duration int
Constructor: DVDString title, String creator, int itemId, String director, int duration
Method: toStringoptional
LibraryMember Class:
Attributes: name String address String contact String memberId int borrowedItems array of LibraryItem fines double
Constructor: LibraryMemberString name, String address, String contact, int memberId
Methods: borrowItemLibraryItem item returnItemLibraryItem item toStringoptional
Library Class:
Attributes: items array of LibraryItem members array of LibraryMember
Constructor: Library
Methods: addItemLibraryItem item addMemberLibraryMember member toString
Main Class:
Create a Library object.
Use a menudriven console interface to:
Add items books or DVDs to the library.
Add members to the library.
Allow members to borrow items.
Allow members to return items.
Display the library's state.
Exit the program.
Ensure the user can interact with the library management system through the console interface, using simple arrays for managing items and members.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
