Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a java code to implement blood donation system in a very small scale. There are four classes, namely: blood bank admin donor patient Description
Write a java code to implement blood donation
system in a very small scale. There are four classes, namely:
blood bank
admin
donor
patient
Description of Classes:
The blood bank class contains an array of static int
variable named blood group which stores the number
of packets available in each blood group currently.
The Administrators can see the number of packets of
blood available for each blood group through the
admin class by entering the password.
Donors can login to enter their details and can donate
one, two or three blood packets.
Patients can login and borrow packet at a time.
Patients can borrow any of the compatible blood
groupsWelcome Menu
Enter if you are the admin
if you are a donor,
if you are a patient or
if you want to exit:Welcome Menu
Enter if you are the admin
if you are a donor,
if you are a patient or
if you want to exit:Admin
Enter if you are the admin
if you are a donor,
if you are a patient or
if you want to exit:
Enter password: Sahar
welcome
A ve:
o ve:
B ve:
:
A ve:
o ve:
B ve:
ve: Donors
Enter if you are the admin,
if you are a donor,
if you are a patient or
if you want to exit:
welcome donor t
Please enter if you want to enter your information:
Enter your name:tony
Enter your sextmale
Enter dateDD MM YY:
Enter type of blood group you are donating:
A positive
positive
B positive
positive
A negative
negative
B negative
AB negative
how many packets of blood are you donating:
Do you want your information to be displayed now Enter if you are the admin
if you are a donor,
if you are a patient or
if you want to exit:
welcome donor
Please enter if you want to enter your information:
Enter your name:natasha
Enter your sex:female
Enter date DD MM YY :
Enter type of blood group you are donating:
A positive
positive
B positive
AB positive
A negative
negative
B negative
AB negative
how many packets of blood are you donating:
Do you want your information to be displayed now
name : natasha
DateDD MM YY:
Blood group: positive
Packets of blood: Patient when the blood group is present in the blood bank
Enter if you are the admin.
if you are a donor,
if you are a patient or
if you want to exit:
Velcome patient III
Enter your nane:groot
snter type of blood group you are looking for;
A positive
o positive
B positive
AB positive
I A negative
negative
B negative
AB neqative
you will be donated with blood packet
please login again to get more blood packet
available blood groups compatible with the entered blood group:
a ve:
a ve:
vet
ve:
Patient when the blood group is not present in the blood
bank
Enter If you are the adnin
if you are a donot.
if you are a patient or
a if you want to exit:
Weleone patient!
Enter your name:loki
Enter type of blood group you are looking for
A positive
o positive
B positive
AB positive A negative
o negative
negative B negative
negative
you vill be donated with blood packet
please login again to get more blood packet
Avallable blood groups conpatible with the entered blood group:
:
ve:
Compatible blood group not availableznter if you are the admin
if you are a dooor?
if you are a patient or
if you want to exiti?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started