Professional Documents
Culture Documents
Using Namespace Char Int Char Int Do Char If: #Include #Include
Using Namespace Char Int Char Int Do Char If: #Include #Include
#include<string>
using namespace std;
char arr[100];
int check(char blood_type[100])
{
int f;
do {
cin >> blood_type;
char* ptr = strstr(arr, blood_type);
if (ptr != NULL)
{
f = 4;
}
else
{
f = 2;
}
char q;
do
{
int a, HP, weight, quantity, disease;
char type[3];
cout << "WELCOME TO BLOOD BANK " << endl;
cout << "MENU" << endl;
cout << "\t\t\t\t\t\DONATE BLOOD\t\t\t\t\t" << endl;
cin >> a;
if (a == 1)
{
cout << "\tWhat is your HP level\t : ";
cin >> HP;
if (HP >= 10 && HP <= 17.5 && weight > 47 && disease == 3)
{
cout << " You have permission to donate blood" << endl;
cin.ignore();
arr[25 + i] = type[3];
}
cout << "THANK YOU FOR DONATING BLOOD " << endl;
if (a == 2)
{
strcpy_s(arr, "A,A+,A-,B,B+,B-,AB+,AB-,AB,a,a+,a-,b+,b,b-
,O,o,O+,o+,o-,O-,ab,ab+,ab-");
int quantity;
char blood_type[2];
int num = 0;
int num1;
{
cout << "Enter a Bottle of Blood Group you Need.. " << i + 1
<< " : ";
num1 = check(blood_type);
if (num1 == 4)
{
cout << "Blood type " << blood_type << " is available:"
<< endl;
}
else
cout << "Blood type " << blood_type << " is not
available :" << endl;
}
cout << " If you want to run it again press y" << endl;
cin >> q;
} while (q == 'Y' || q == 'y');
system("color 6b");
system("pause");
return 0;
}