Professional Documents
Culture Documents
Pharmacy
Pharmacy
struct Date
};
class Drug {
string Drug_name;
int Drug_Number;
float Price,Quantity;
Date Expire_Date;
public:
this->Drug_name = Drug_name;
this->Drug_Number = Drug_Number;
this->Quantity = Quantity;
Expire_Date.year = Expire_year;
Expire_Date.month = Expire_month;
}
this->Price = Price;
};
Drug* P;
int N;
public:
Pharmacy() {
P = NULL;
void Insert_Info() {
system("CLS");
string Drug_name;
int Drug_Number;
float Quantity;
Date Expire_Date;
float Price;
cin >> N;
P = new Drug[N];
system("CLS");
for (int i = 0; i < N; i++)
P[i].Assign_Drug_name(Drug_name);
P[i].Assign_Drug_Number(Drug_Number);
P[i].Assign_Quantity(Quantity);
P[i].Assign_Expire_Date(Expire_Date.year, Expire_Date.month);
P[i].Assign_Price(Price);
system("pause");
void Prin_Info()
system("CLS");
{
cout << "(" << i + 1 << ") Drug Info:\n";
system("pause");
void _2Month_to_Expire() {
system("CLS");
if (Result == 6)
system("pause");
~Pharmacy()
delete P;
system("CLS");
system("pause");
};
int main() {
Pharmacy Kurdistan;
Start:
system("CLS");
int choice;
cout << "1.Insert Drugs Information.\n2.Print Drugs Information.\n3.Check 2 Month Expire Date
Left.\n";
if (choice==1)
Kurdistan.Insert_Info();
else if (choice==2)
Kurdistan.Prin_Info();
else if (choice==3)
Kurdistan._2Month_to_Expire();
else if (choice==4)
system("cls");
cout<<Kurdistan.Day_To_Day_Trans(Yesterday_Quantity,Today_Quantity)<<endl;
system("pause");
else
goto Start;