I'm trying(but failing) to write a library sytem program for a college assessment. Library system contains only books and journals. Can b several copies of a book. Staff members can also b lib- mems, and only they can borrow journals. Staff can borrow up to 12 items but other mems can only borrow up to 6 items. System must produce reminders when a book is overdue. books on loan can b reserved. Can only extend the loan of a book if it is not reserved.
I have been told that the application should hold an array of pointers to items(copies of books or journals), and an array of library members(who may be members of staff).
My question is HOW and WHERE I would implement these arrays?
I've always been very unsure when it comes to dealing with arrays and I would be greatful if someone could shed a bit of light on the situation as I feel I have hit a brick wall here.
First off, decide on the data you need
a library member would perhaps contain
- staff/student flag
- number of borrowed items
- array of 'n' pointers to books/journals
A book/journal contains
- book/journal flag
- is on loan to (pointer to library member)
- is reserved by (pointer to library member)
- return date
Then think about such functions as
- member reserves book
- member borrows book
- member returns book
- search for books overdue