VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUHAMMAD-AL XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
LABARATORIYA ISH Dori mahsulotlari haqida ma’lumot beruvchi dastur(kichik loyiha).
BAJARDI 008-L3 GURUH TALABASI : Abdug’afforov Akromjon TEKSHIRDI :Mirzayeva Gulmira
TOSHKENT-2022
#Dori mahsulotlari haqida ma’lumot beruvchi dastur(kichik loyiha).
#include
#include #include #include #include #include #include #include #define max 10
using namespace std;
class medicineType
{
public:
void take_order();
void delete_order();
void modify();
void order_list();
void daily_summary();
void exit();
medicineType();
};
medicineType::medicineType ()
{
}
struct node
{
int reciept_number;
string customerName;
string date;
int quantity[10];
string type = {"OTC"};
int x, menu2[10];
double amount[10];
string medicineName[10]={"Parasetamol","Vitamin C(500mg)","Aspirin","Trimol","Kyupen","Mezim","Spirt","Pikovit(500mg)","Intellan","Propolis"};
double Medicine[10] = {2.00,3.00,1.00,4.00,1.00,5.00,7.00,4.00,3.00,5.00};
double total;
medicineType medicine;
int menu;
do
{
system("cls");
cout<<"\t\t\t DORIXONA BOSHQARUV SISTEMASI \n";
cout<<"\t\t==================================================\n\n";
cout<<"\t\t--------------------------------------------------\n";
cout<<"\t\t\t1. Yangi dori buyurtmasini olish \t\t \n";
cout<<"\t\t\t2. Oxirgi dori buyurtmasini o’chirish\t\t \n";
cout<<"\t\t\t3. Buyurtmalar ro’yxatini o’zgartirish \t\t\t \n";
cout<<"\t\t\t4. Kvitansiyani chop etish va to’lash \t \n";
cout<<"\t\t\t5. Jami savdoning kunlik xulosasi\t\t \n";
cout<<"\t\t\t6. Chiqish\t\t\t\t\t \n";
cout<<"\t\t--------------------------------------------------\n";
cout<<"Kerakli bo’limni tablant: ";
cin>>menu;
switch (menu)
{
case 1:
{
medicine.take_order();
break;
}
case 2:
{
medicine.delete_order();
system("PAUSE");
break;
}
case 3:
{
medicine.modify();
system("PAUSE");
break;
}
case 4:
{
medicine.order_list();
system("PAUSE");
break;
}
case 5:
{
medicine.daily_summary();
system("PAUSE");
break;
}
case 6:
{
medicine.exit();
goto a;
break;
}
last = temp;
delete q;
cout<<"Kvitansiya muvaffiqiyatli o’chirildi."<}
else
cout<<"O’chirilishi kerak bo’lgan element ro’yxatda yo’q."<}
}
}
void medicineType::modify()
{
system("cls");
int i, ch, sid;
bool found;
found = false;
temp = start_ptr;
cout<<"O’zgartirish uchun chez raqamini kiriting: ";
cin>>sid;
if (temp==NULL && sid==0)
{
cout<<"O’ZGARTIRISH UCHUN MA’LUMOT YO’Q..!"<}
else
{
while(temp !=NULL && !found)
{
if (temp->reciept_number==sid)
{
found = true;
}
else
{
temp = temp -> next;
}
if (found)
{
cout << " Buyurtma raqamini o'zgartirish: ";
cin >> temp->reciept_number;
cout<< " Mijoz ismini o'zgartirish: ";
cin>> temp->customerName;
cout<<" Sanani o'zgartirish : ";
cin>>temp->date;
cout << "Qancha dori miqdorini xohlaysiz(yangi miqdor):"<< endl;
cout<<"( Maksimal 10 ta buyurtma ) \n";
cout << " " ;
cin >> temp->x;
if (temp->x >10)
{
cout << "Siz buyurtma qilgan dori miqdori maksimal buyurtma miqdoridan oshib ketgan !";
system("pause");
}
else{
for (i=0; ix; i++)
{
cout << " Oʻzgartirish uchun tanlovingizni kiriting: "<cin>> temp->menu2[i];
cout<< "Dori nomini o'zgartirish: " <medicineName[temp->menu2[i]-1]<cout << "Qancha dori miqdorini xohlaysiz(yangi miqdor): ";
cin >> temp->quantity[i];
temp->amount[i] = temp->quantity[i] * temp->Medicine[temp->menu2[i]-1];
cout << "O'zgartirishdan keyin to'lashingiz kerak bo'lgan miqdor: " << temp->amount[i]<<" SO'M"<system("PAUSE");
}
temp = temp->next;
system("cls");
}