Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Course Code: M251

Course Title: Object Oriented Programming Using Java

Tutor Marked Assignment

Cut-Off Date: TBA Total Marks: 100

This TMA covers the first 9 sessions. It consists of a three-phase project. Please solve all phases.
You must submit your source files well commented in a Java project (use your name and your
student ID in naming your project). Also you must submit a single word file containing:

- A copy and paste of all java code.


- Snapshots of different program runs.
- If your code does not completely work, attach somedescription to explain the status of
the code and the runs.
- Answer the question below

You have two submission links on your LMS page:

 The regular submission link to upload a zipped folder of your Java project.
 The turnitin submission link to upload the word file.

Your TMA will not be marked if not all the required files are submitted on the two submission
links.

Plagiarism Warning:

As per AOU rules and regulations, all students are required to submit their own TMA work and
avoid plagiarism. The AOU has implemented sophisticated techniques for plagiarism detection.
You must provide all references in case you use and quote another person's work in your TMA.
You will be penalized for any act of plagiarism as per the AOU's rules and regulations.

Declaration of No Plagiarism by Student (to be signed and submitted by student with TMA
work):
I hereby declare that this submitted TMA work is a result of my own efforts and I have not
plagiarized any other person's work. I have provided all references of information that I have
used and quoted in my TMA work.

Name of Student:
Signature:
Date:
Overview

In order to maintain a safe and healthy blood supply, some hospitals have a division to store
and preserve blood donations for later use in blood transfusion. It is sometimes referred to a
blood collection center. There are different types of blood donations including whole blood,
power red cell, platelet, and plasma donations.
In the blood collection center, the details of donors are stored to be contacted whenever a
requirement of blood is needed.
In this TMA you’re required to implement a blood collection Application. The requirements for
this application are in the following phases:

Phase 1:

Create a separate class each in a .java file to represent a blood collection center, a donor, a
blood donation.
The blood collection center has a name and a list of eligible donors. Each donor has a name,
blood type and contact number. The donor has also single list to keep track of all his/her blood
donations’ types at specific dates. Initially the list is empty.
Types of blood donations are:

1. Whole Blood Donation: it is the most flexible type of donation. It can be transfused in its
original form, or used to help multiple people when separated into its specific
components of red cells, plasma and platelets.
Ideal blood types: All blood types.
Waiting period: 56 days.

2. Power Red Donation: during a Power Red donation, the donor give a concentrated dose
of red cells only.
Ideal blood types: O positive, O negative, A negative, and B negative.
Waiting period: 112 days, up to 3 times/year.

3. Plasma Donation: plasma is a part of the blood used to treat patients in emergency
situations. Plasma can be given to anyone regardless of their blood type.
Ideal blood types: AB positive, AB negative.
Waiting period: 28 days, up to 13 times/year.
4. Platelet Donation: platelets are tiny cells in blood that form clots and stop bleeding.
Platelets are most often used by cancer patients and others facing life-threatening
illnesses and injuries.
Ideal blood types: A positive, A negative, B positive, O positive, AB positive and AB
negative.
Waiting period: 7 days, up to 24 times/year.

Note:
 Waiting period is the period that a donor should wait after the donation in order to be
capable for giving another donation.

Create a class for each blood donation type and define necessary attributes and methods.

Each class must store its state in private variables. All required access is done through public
methods. The public methods which you must implement allow the user to do the following:

- Initiate, get and set the state of any created object.


- Create a new blood collection center and give it a name.
- Add a donor to the center if he/she is not already in the donors list.
- For each donor, list the ideal blood donation types based on the donor’s blood type.
- For each donor, determine whether the donor is capable for a new donation based on
the most recent donation date among all his/her past donations records, the given
waiting period constraints in each respective blood donation type and the total number
of donations given by him/her during the last year (i.e. the last 365 days).
- Add a blood donation for a donor assuming all given donor’s data is correct in time
frame with respect to his/her past donation records (i.e. ordered chronologically).
- Dump the center structure into text. The text should include center name and donors
list which shows their blood donations details along with a status field that shows
whether the donor is capable for a new blood donation or not.
- Save the information of the blood collection center into a file.

If the user attempts do an operation that will violate the state of objects, you must check for it.
In that case, the operation should be ignored and the application should give back an error
message.

Phase 2:

The application should use a text file to capture the whole center structure. To do this, add two
methods to your center class:
1. A method to save the content of the created Java structure into a text file.
2. A method to restore the saved content back into an appropriate Java data structure for
next run time.
Java provides a facility to create your own Exceptions which are basically derived classes of
Exception. Write a class that defines a duplicate exception. The duplicate exception will be
thrown if donors are duplicated in the donors list.

Design and implement a separate testing class to test the designed classes and check if classes
meet the requirements.

Phase 3:

The application has to be a GUI (Graphical User Interface) application. Create a window that
includes a window title: Title of your project. Design your window by using minimum four
different user interface controls like labels, text field, buttons, text area, etc.

Question:

What is the best choice to reuse your written code, if the center would consider plasma,
platelet and power red cells are all kind of Apheresis donation type which is made possible
using a special machine that separates the components of the blood? Justify your answer.

Marks distribution:
1. 10 marks for the correct design implementation of center structure.
2. 10 marks for the correct design implementation of donor structure.
3. 5 marks for the correct design implementation of blood donation structure.
4. 6x4 marks for the correct design implementation of each blood donation type
5. 6 marks for loading the center structure from a text file successfully.
6. 2 marks for saving the center structure to a text file successfully.
7. 4 marks for the duplicate Exception class.
8. 27 marks for the correct design and implementation of the GUI JavaFx application which
fulfill all user requirements
9. 2 marks for the correct design and implementation of test methods/class
10. 2 marks for screenshots of correct execution.
11. 6 marks for code quality including; comments, style and design.

Important notes on plagiarism detection and other penalties:

 Penalty on similarities: A student will receive ZERO for any copied method.
 Penalty for not including the word document: 10 % of the achieved mark.
 Penalty for not including the project Java files: 50% of the achieved mark.
 Penalty on late submission: 10% for each day.

End of Assessment

You might also like