Part A

Part A of this assignment is based around the following description of a system needed for a registered charity. You are required to analyse this description and to produce an object oriented model for this (documented as a UML diagram).

Task 1

List all the nouns and verbs (and noun and verb phrases where appropriate) in the description of the system described below.

Task 2

Having analysed the noun and verb lists as candidate classes and methods (as in Unit 4 of the course material):

  • List your selection of classes
  • Also choose three other nouns and/or verbs (inc. phrases) that are accepted or rejected as candidate methods (each for different reasons) and briefly explain the decision you reached about each.

Task 3

Propose an object oriented model to solve the specified problem and document this as a UML class diagram. You should include

  • data types of instance variables, parameters and method return values (when non-void)
  • visibility modifiers
  • constructors
  • relationships such as generalisation/specialisation and association. Hand drawn UML diagrams are perfectly acceptable but must be neat and clearly legible.

Appendix A: Scenario

A registered charity has its main office in London and aims to help people who have become unemployed. The charity requires a system to keep track of goods donated (TV's, toys, computers, books, CDs etc) i.e. items that have been donated by members of the public. Additionally the charity needs to know where these items are stored so that it can distribute them to unemployed people who live locally. The charity does not want to transport goods unnecessarily over long distances. All donated items are classed as one of two types:-New Items and Used items.

For each item donated the following information is stored:-the type at the Item (TV, DVD player, book etc -stored as a string), its financial value in pounds (an integer), its storage location (string) which is usually the nearest large city to where it was donated e.g. Manchester, Birmingham or London. The value of an item is initially set to zero for all items. This value can be checked by a user at the system. Each item is described by its type and location.

New Items have their value assessed by a human assessor employed by the charity based on the amount that the charity could reasonably expect to sell this item for. The value of the item will be set to the value provided by the assessor (an integer). New items also have a guarantee (boolean value) which is true or false depending upon whether it comes with a guarantee. This value is set as true or false when an item is donated and can be checked by a user of the system.

Used items do not have their financial value checked. The initial value set to zero remains unchanged. However they do have a 'Safe' status (boolean) which is assumed to be false when the item is donated. Each item is tested (visually inspected). If the test is passed the value Safe will be set to true and a message is displayed to say 'Item passes visual inspection'. Used items are described by their type, location and 'Safe' status.

Some used items belong to a subcategory of Used Electrical Goods. In addition to the visual inspection when used electrical items are checked they must pass an electrical test and an additional message 'Item passes electrical safety test' must be displayed to confirm this.

Finally the charity keeps a Catalogue of donated items. It must be possible to add donated items to this catalogue, delete donated items (once they have been given away), list items in the catalogue that are at a specified location and print a stock report (this simply calculates and displays the total number of items in the catalogue and their total value in pounds).

PART B

Part B of this assignment is based around a very brief description of a system needed for a university library. A model of a proposed system is included as a UML diagram as is a detailed description of each class and operation. You are required write a Java program, using the BlueJ IDE, to implement a solution as specified by this documentation. Create additional accessor methods if these are required.

Task 4

Implement and test the model in Java using BlueJ. You should apply ALL the coding conventions exemplified in the code presented in Units 1-4 including naming, layout and commenting: 10% of the marks will be explicitly awarded on this and poor presentation may adversely affect marks for other aspects if it obscures the correctness of otherwise satisfactory code.

Task 4 should be submitted as a working BlueJ project. A printout of the code must also be submitted.

Scenario

The University Library requires a system to keep track of the material registered users borrow and to record fines for late returns. Registered users, students at the University, will gain entrance to the university library outside of normal opening hours using a university swipe card. This card will also be used when borrowing or returning material. A model is required which represents the key characteristics of the users of the library.

Each user has a name, library number (stored as text), the number of books currently on loan and the number of items returned late. A user can borrow a book or return a book. When a book is returned its status is noted (true if late). Ii a book is returned late then the number of items returned late is incremented (this value is never decremented). A user is described by their name and library number e.g. "Simon Kendal 01234".

All usersstudents fall into one of the following two categories :-undergraduate students or research staff.

If undergraduate students return a book late £1 is added to their outstanding fine (in addition to the normal action of incrementing the number of items returned late). Students can payoff all of their fine in one lump sum (but they cannot payoff part of their fine). Additionally each undergraduate student has a list of reserved books.

A list of reserved books is maintained (one list for each undergraduate student). A book title can be added to the list and the list can be printed in alphabetical order. Using this, students can reserve a book and display the list of reserved books.

Full time undergraduate students are allowed to borrow up to 6 books. Part time undergraduate students are allowed to borrow 3 books.

Researchers are allowed to borrow and return research papers as long as the number of research papers on loan does not exceed 10. Research staff are not fined for late books (as undergraduate students are) though, as for all library users, the number of items (books or research papers) returned late is recorded.

Notes, Hints, Tips and Caveats

Particularly for Part A

  • The expected solution will contain five classes, four of which are related in an inheritance hierarchy, the remaining one being related by an association.
  • There are no interfaces (in the sense of a Java "interface" declaration) in the expected solution.
  • The expected solution will employ polymorphic use of class types so as to store and process donated items without concern for their specific variations.
  • Consider how the phrase "is described as" might be related to the toString() method.
  • None of the classes is expected to receive input directly from the user, so any data required by constructors or methods should be passed as parameters.

Particularly for Part B

  • All outputs should be as pop-up messages using the User class, except for the reserved book list which should be displayed on the system console (in alphabetical order).
  • The list of reserved books may be stored using arrays (as covered in the prerequisite module last year), or you may choose to use classes from the Java Collections Framework as seen in Units 5 and 6 of this module. Equal marks will be available in either case.
  • If necessary you may assume a maximum of 10 reserved books per list.
  • Be clear that you are not developing a complete application but rather a set of classes which would be part of an application processing details about workers for a charity. In this sense they are like the classes in the Publications projects from the course material which, in that case, might be used within a larger point-of-sale and stock control application.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.