1.3-Object-Georienteerd-Programmeren

Bookcase

There is a bookcase, it can hold a number of books. A bookcase can hold a maximum number of books. Books can be put into the bookcase and books can be removed from the bookcase. The bookcase knows at any time how many books are in the bookcase. A book has an ISBN number, a title, a number of pages, and is written by an author. An author has a name and a date of birth. Each author’s current age can be retrieved.

From the above case, create the classes, including attributes and methods. Make use of constructors, getters and setters (if necessary). Use and test your model, by creating some objects from the different classes. At least two bookcases should be created. You then fill these objects with representative data. By calling the methods, you can check if the result matches your expectations.

Build methods that allow you to perform the operations below, or answer the questions:

Tip:

Note that we have hidden all (other) private attributes. It is up to you to implement these correctly!

Sequence Diagrams

Not all methods have been worked out and not all details have been filled in.

Add a book to a bookcase

Who is the oldest author in a bookcase