A local book shop that has approached you to build them a computerised stock control system and point of sale system.
The shop sells a large number of books which are classified into genres: Non-Fiction (Science,Mathematics, Humanities, Languages, Arts), Science Fiction (SciFi, Steampunk, Apocalyptic, Time Travel), Crime Fiction (Legal, Spy, Whodunnit, Suspence) and Literary Fiction.

Each book has a title (e.g. “The Hitchhikers Guide to the Galaxy”) an author (e.g. “Douglas Adams”), a date of publication, a cost (how much the shop paid for the book) and a price (how much they will sell the book for).
· The non-fiction books also need to record details of what degree courses they are suitable for and which year of study (e.g. “Software Engineering”, “Level 2”), and a list of Universities which use the book.
· Crime Fiction books need to record the type of crime involved (e.g. “Murder”, “Theft”, “Fraud”).
· The Science Fiction books need to record which years the books are set in (e.g. 3010—3025).

The shop purchases its stock from a number of different suppliers. It usually telephones the supplier to order books and will pay for the book when it is delivered. The system will need to record the orders and actual purchases (i.e. delivery) from a supplier giving the name of the supplier, the date of purchase and the amount paid. Once purchased, the book is added to the shop’s inventory.

2. The system will also need to record all sales of books to customers showing the customer, the date of the sale and the amount paid. The shop have asked that the system should be able to provide them with information about the number and total amount of purchases from each of their suppliers each month, the number of sales and total price for each genre of book each month.

7 Years
Discussion Span
Last Post by j_cart007

Have a class named Book , inherit all special books from book .

Thnx for ur help!
but, what about other classes apart from Book ?



Anything that is an Object... is an Object so make it a class.

Science Fiction, Non Fiction, Literary Fiction, and Crime Fiction are dead give aways that your teacher wants you to make them types (either Abstract classes or just a class where everything in that genre extends from it). And of course Science Fiction, Non Fiction, etc should all extend Book because they are all Books. Book, being your most generic class, should in some way be the ancestor of everything else. I'll leave it to you to work the rest out.


Thanks alot for ur help sir.
I've come up with this class diagram attached if u can have a look at it pls and if anything seems ambigious so correct me aswell pls.

Best Regards.

Attachments ClsDgm_WlvBooks4U.jpg 202.32 KB
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.