Answered step by step
Verified Expert Solution
Link Copied!

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:
4 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.
5 The Administrators can see the number of packets of
blood available for each blood group through the
admin class by entering the password.
6 Donors can login to enter their details and can donate
one, two or three blood packets.
7 Patients can login and borrow 1 packet at a time.
Patients can borrow any of the compatible blood
groupsWelcome Menu
Enter 1 if you are the admin ,
2 if you are a donor,
3 if you are a patient or
4 if you want to exit:Welcome Menu
Enter 1 if you are the admin ,
2 if you are a donor,
3 if you are a patient or
4 if you want to exit:Admin
Enter 1 if you are the admin ,
2 if you are a donor,
3 if you are a patient or
4 if you want to exit: 1
Enter password: Sahar
welcome !!!
A +ve: 0
o +ve: 3
B +ve: 2
AB+ve:0
A -ve:0
o -ve: 0
B -ve: 2
AB-ve: 0Donors
Enter 1 if you are the admin,
2 if you are a donor,
3 if you are a patient or
4 if you want to exit:2
welcome donor 11 t
Please enter 1 if you want to enter your information:1
Enter your name:tony
Enter your sextmale
Enter date(DD MM YY):28052000
Enter type of blood group you are donating:
0=A positive
1=0 positive
2- B positive
3=AB positive
4- A negative
5=0 negative
6= B negative
7- AB negative
2
how many packets of blood are you donating: 2
Do you want your information to be displayed now (YN)NEnter 1 if you are the admin ,
2 if you are a donor,
3 if you are a patient or
4 if you want to exit:2
welcome donor !!!
Please enter 1 if you want to enter your information: 1
Enter your name:natasha
Enter your sex:female
Enter date (DD MM YY) :26052000
Enter type of blood group you are donating:
0= A positive
1=0 positive
2= B positive
3= AB positive
4- A negative
5=0 negative
6= B negative
7= AB negative
1
how many packets of blood are you donating: 3
Do you want your information to be displayed now (YN)Y
name : natasha
Date(DD MM YY):2652000
Blood group:1=0 positive
Packets of blood: 3Patient ( when the blood group is present in the blood bank)
Enter 1 if you are the admin.
2 if you are a donor,
3 if you are a patient or
4 if you want to exit:3
Velcome patient III
Enter your nane:groot
snter type of blood group you are looking for;
0- A positive
o positive
2- B positive
= AB positive
I =A negative
5=0 negative
= B negative
7- AB neqative
you will be donated with 1 blood packet
please login again to get 1 more blood packet
available blood groups compatible with the entered blood group:
a +ve: 0
a - ve: 0
+vet 3
-ve: 0
Patient ( when the blood group is not present in the blood
bank)
Enter 1 If you are the adnin ,
2 if you are a donot.
3 if you are a patient or
a if you want to exit: 3
Weleone patient! !!
Enter your name:loki
Enter type of blood group you are looking for
0- A positive
1- o positive
2- B positive
3- AB positive 4= A negative
5- o negative
5-0 negative 6- B negative
7=AB negative
you vill be donated with 1 blood packet
please login again to get 1 more blood packet
Avallable blood groups conpatible with the entered blood group:
B-ve:0
-ve:0
Compatible blood group not availableznter 1 if you are the admin ,
2 if you are a dooor?
3 if you are a patient or
4 if you want to exiti?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions