As a team, fork this repository to an Organization and submit the URL of your fork via the Student Portal. Each teammate will submit the SAME URL.
- Objective: To implement a library management system
- Purpose: To demonstrate the four pillars of OOP
- Consider a system in which
Address
has astreet
,city
,state
, andzipCode
.Searchable
itemmatchesKeyword
by searchinggetSearchableFields
to if any contain a defined String.Reservable
item can bereserve
orcancelReserve
by aLibraryMember
. depending on theirisReserved
flag.LibraryItem
isSearchable
, and has anid
,title
,location
and availability based on itsisAvailable
flag.LibraryItem
can becheckOut
andcheckIn
, which sets theirisAvailable
flag.LibraryItem
must be able tocalculateLateFee
,getMaxBorrowDays
andgetItemType
.Book
is aLibraryItem
that hasauthor
,isbn
, number ofpages
andgenre
. TheSearchableFields
ofBook
aretitle
,author
,genre
andisbn
.Book
isReservable
, and has a late fee of $0.50 per day, can be borrowed for 14 days, and is typeBook
.Periodical
is aLibraryItem
that haspublisher
,issn
,volume
,issueNumber
andpublicationDate
.SearchableFields
ofPeriodical
aretitle
,publisher
andissn
.Periodical
has a late fee of $0.25 per day, can be borrowed for 7 days, and is typePeriodical
.DVD
is aLibraryItem
that hasdirector
, minutes ofduration
,rating
, andgenre
. TheSearchableFields
ofDVD
aretitle
,director
andgenre
.DVD
isReservable
, and has a late fee of $1.00 per day, can be borrowed for 7 days, and is typeDVD
.
Person
has aname
,age
,email
, andphonenumber
.Librarian
is aPerson
that hasemployeeId
,department
andsalary
. ALibrarian
canaddItemToLibrary
andremoveItemFromLibrary
.LibraryMember
is aPerson
that hasmemberId
,membershipDate
,List
ofborrowedItems
which areLibraryItems
,outstandingFees
, andaddress
.LibraryMember
canborrowItem
, whichcheckOut
item and adds item toborrowedItems
; canreturnItem
, whichcheckIn
item, removes item fromborrowedItems
, andcalcuateLateFee
based on item anddaysLate
; and canpayFees
, which reducesoutstandingFees
byamount
.
Library
hasname
,address
,items
is aList
ofLibraryItem
,members
is aList
ofLibraryMember
,librarians
is aList
ofLibrarian
.Library
canaddItem
,removeItem
, which adds or removesLibraryItem
to or fromitems
;addMember
, which addsLibraryMember
tomembers
;addLibrarian
, which addsLibrarian
tolibrarians
; andsearch
, which searchesitems
for a Stringkeyword
;displayAllItems
lists the item type, title and availability;generateLateFeeReport
lists the member name, and their list ofborrowedItems
, includingtitle
,maxBorrowDays
andcalculateLateFee
.
Hypatia
, is theLibrarian
ofCentral Library
, at123 Main St
,Alexandra
,DE
12345
. HeremployeeId
isL001
, and she makes $45000
a year. TheLibrary
has- 2
Book
.B001
isJava Programming
byJohn Doe
, 500 pages, located inA1
,isbn
is978-1234567890
,genre
isProgramming
.B002
isData Structures
byJane Smith
, 400 pages, located inA2
,isbn
is978-0987654321
,genre
isComputer Science
.
- 2
Periodical
.P001
isByte
published byMcGraw-Hill, Inc.
, vol6
, issue8
, located inP1
,issn
is0360-5280
, published08/01/1981
.P002
isDr. Dobb's Journal
published byM&T Publishing, Inc.
, vol10
, issue6
, located inP1
,issn
is0278-6508
, published06/01/1985
.
- 1
DVD
.D001
isThe Matrix
, directed byWachowski Sisters
,136
minutes, ratedR
, located inD1
,genre
isSci-Fi
.
- 2
LibraryMember
.M001
isAlice Johnson
,age
25
,email
alice@email.com
,phoneNumber
555-1234
,address
is456 Oak St
,Bookville
,MD
12347
.M002
isBob Wilson
,age
35
,email
bob@email.com
,phoneNumber
555-4321
,address
is654 Maple St
,Media
,PA
12346
.
- 2
- Create test cases that describe the
Library
, itsitems
,members
andlibrarians
. - Generate a late fee report.
ask yourselves:
- What are
List
s andArrayList
s? - How can they be used here?