0% found this document useful (0 votes)
11 views5 pages

(CS304) Solution No 1

Uploaded by

areeshaali907
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

(CS304) Solution No 1

Uploaded by

areeshaali907
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment No: 01

VUID: BC210403684
Book Code: CS304
. Identify Main Objects (Entities) of the System

The key entities (objects) in this system are:

• Donor
• Patient
• Blood Inventory
• Hospital
• Admin
• Donation
• Blood Request
• Blood Type

2. Identify Attributes and Functions for Each Object

• Donor
o Attributes:
▪ donorID: String
▪ name: String
▪ age: Integer
▪ bloodType: BloodType (association with BloodType class)
▪ contactInfo: String
▪ lastDonationDate: Date
▪ eligibilityStatus: Boolean
o Functions:
▪ register(): Boolean
▪ updateProfile(): Boolean
▪ viewDonationHistory(): List<Donation>
▪ checkEligibility(): Boolean
▪ sendReminder(): Void
• Patient
o Attributes:
▪ patientID: String
▪ name: String
▪ age: Integer
▪ bloodType: BloodType (association with BloodType class)
▪ contactInfo: String
▪ medicalHistory: String
▪ bloodRequestStatus: BloodRequest
o Functions:
▪ registerRequest(): Boolean
▪ trackRequestStatus(): BloodRequest
▪ viewEligibility(): Boolean
• Blood Inventory
o Attributes:
▪ inventoryID: String
▪ bloodType: BloodType
▪ quantityAvailable: Integer
▪ expirationDate: Date
o Functions:
▪ checkAvailability(): Boolean
▪ updateInventory(): Void
▪ notifyExpiry(): Void
• Hospital
o Attributes:
▪ hospitalID: String
▪ name: String
▪ location: String
▪ contactInfo: String
o Functions:
▪ viewDonorDetails(): List<Donor>
▪ selectDonor(donor: Donor): BloodRequest
▪ placeBloodRequest(bloodRequest: BloodRequest): Void
• Admin
o Attributes:
▪ adminID: String
▪ name: String
▪ contactInfo: String
o Functions:
▪ manageDonorRegistrations(): Void
▪ manageBloodInventory(): Void
▪ handleBloodRequests(): Void
▪ sendRemindersToDonors(): Void
▪ monitorExpiryDates(): Void
• Donation
o Attributes:
▪ donationID: String
▪ donor: Donor
▪ donationDate: Date
▪ bloodType: BloodType
▪ quantity: Integer
o Functions:
▪ recordDonation(): Void
▪ viewDonationDetails(): Void
• Blood Request
o Attributes:
▪ requestID: String
▪ patient: Patient
▪ bloodTypeRequired: BloodType
▪ quantityRequested: Integer
▪ status: String (e.g., Pending, Fulfilled, Rejected)
o Functions:
▪ createRequest(): Void
▪ trackRequestStatus(): String
• Blood Type
o Attributes:
▪ typeID: String
▪ bloodType: String (e.g., A+, B-, O+, AB-)
o Functions:
▪ getBloodTypeInfo(): String
▪ checkCompatibility(bloodType: BloodType): Boolean

3. Identify Relationships among Identified Objects

• Donor and Donation:


o One-to-many relationship: A donor can donate multiple times. (A donor can have
many donations, but each donation belongs to one donor.)
• Patient and Blood Request:
o One-to-many relationship: A patient can request blood multiple times. (A patient
can create multiple requests, but each request is linked to one patient.)
• Blood Request and Blood Inventory:
o One-to-one relationship: A blood request is fulfilled by a single blood inventory
entry (specifically, a single blood type).
• Hospital and Blood Request:
o One-to-many relationship: A hospital can make multiple blood requests, but each
request is associated with one hospital.
• Admin and Donor/Patient/Blood Inventory:
o Admin has control over donors, patients, and inventory. (Admin can manage all
these entities.)
• Donor and Blood Type:
o One-to-one relationship: A donor can have only one blood type, and each blood
type is associated with many donors.
• Blood Inventory and Blood Type:
o One-to-many relationship: Each blood type can have multiple inventory entries
(e.g., different dates, quantities).
• Admin and Blood Inventory:
o One-to-many relationship: Admin can manage multiple blood inventory records.

You might also like