Feedback for these lessons is very much welcome. If you like or hate something about a lesson let us know, either on GitHub, via Mail or just tell us in person ;)
x
B09 - Advancing the Library
Lets add some useful functionality to our library project1. The tests 2 for this exercise will help you work out the correct implementation. Use them!
What’s to do
- Add (readonly) static limit
MAX_MEDIA_COUNTtoUserAccountto express that a user can only borrow 10 items - Add
BorrowandReturnMediamethods toUserAccount(return bool) ReturnMediashould also update the Fees- You can only return what you have borrowed.
- You can only borrow if
MAX_MEDIA_COUNTis not reached - Add a property
BorrowedCounttoUserAccountthat gives the curred number of borrowed items of this account - Add
BorrowandReturnMemethods toMediumthat marks/unmarks the borrower (UserAccount) and sets the returnDate/calculates the fees if late - Add a method
AuthentificatetoLibraryto identify a user. It shall take an long id and return aUserAccountobject or null if this id is not connect to any account