Labaratoriya ish



Download 0,89 Mb.
Sana03.11.2022
Hajmi0,89 Mb.
#859837
Bog'liq
Abdugafforov Akramjon-----Kichik loyiha123

O’ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI


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;

node *prev;


node *next;
node *link;

}*q, *temp;


node *start_ptr = NULL;
node *head = NULL;
node *last = NULL;

int main()


{

system("COLOR 0");


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;
}

default:
{


cout<<"Noto’g’ri kiritdingiz\nQaytadan kiriting\n"<break;
}
}
}while(menu!=6);
a:
cout<<"RAHMAT"<system ("PAUSE");
return 0;
}

void medicineType::take_order()


{
system("cls");
int i;
int choice, quantity, price,None;

cout <<"\nBuyurtma tafsilotlarini kiriting\n";


cout <<"_____________________________________ \n\n";

node *temp;


temp=new node;

cout <<"**************************************************************************\n";


cout<<"DORI IDsi"<<"\tDORI TURI" <<" \t\tDORI NOMI "<<" DORI NARXI(SO’M)"<cout <<"**************************************************************************\n";
cout<<"0001"<<"\t"<<"\tOTC"<<"\t\t"<<" Parasetamol"<<" 2000(SO’M)"<cout<<"0002"<<"\t"<<"\tOTC"<<"\t\t"<<" Vitamin C(500mg)"<<" 30000(SO’M)"<cout<<"0003"<<"\t"<<"\tOTC"<<"\t\t"<<" Aspirin"<<" 1000(SO’M)"<cout<<"0004"<<"\t"<<"\tOTC"<<"\t\t"<<" Trimol"<<" 7000(SO’M)"<cout<<"0005"<<"\t"<<"\tOTC"<<"\t\t"<<" Kyupen"<<" 1000(DONA)(SO’M)"<cout<<"0006"<<"\t"<<"\tOTC"<<"\t\t"<<" Mezim"<<" 20000(SO’M)"<cout<<"0007"<<"\t"<<"\tOTC"<<"\t\t"<<" Spirt"<<" 2000(SO’M)"<cout<<"0008"<<"\t"<<"\tOTC"<<"\t\t"<<" Pikovit(500mg)"<<" 40000(SO’M)"<cout<<"0009"<<"\t"<<"\tOTC"<<"\t\t"<<" Intellan"<<" 80000(SO’M)"<cout<<"0010"<<"\t"<<"\tOTC"<<"\t\t"<<" Propolis"<<" 500(DONA)(SO’M)"<cout<<" "<temp = new node;
cout << "Buyurtma raqami : ";
cin >> temp->reciept_number;
cout<< "Mijoz ismi: ";
cin>> temp->customerName;
cout<<"Sanani kiriting : ";
cin>>temp->date;
cout << "Qancha dori buyurtma qilmoqchisiz:"<< endl;
cout<<"( Maksimal 10 ta buyurtma ) \n";
cout << " " ;
cin >> temp->x;
if (temp->x >10)
{
cout << "Sizning buyurtmangiz maksimal miqdordan oshib ketgan !";
system("pause");
}
else{
for (i=0; ix; i++)
{
cout << "Iltimos, tanlovingizni kiriting : "<cin>> temp->menu2[i];
cout<< "Dori nomi: " <medicineName[temp->menu2[i]-1]<cout << "Qancha dori olmoqchisiz : ";
cin >> temp->quantity[i];
temp->amount[i] = temp->quantity[i] * temp->Medicine[temp->menu2[i]-1];
cout << "To’lash kerak bo’lgan miqdor: " << temp->amount[i]<<" SO’M"<system("PAUSE");
}
cout<<"==========================================================================="<cout << "BUYURTMA MUVAFFAQIYATLI QABUL QILINDI :) "<cout<<"==========================================================================="<cout << "TO’LOVNI AMALGA OSHIRISH UCHUN KVITANSIYA BO’LIMIGA O’TING "<cout<<"==========================================================================="<system ("PAUSE");

temp->next=NULL;


if(start_ptr!=NULL)
{
temp->next=start_ptr;
}
start_ptr=temp;
system("cls");
}
}

void medicineType::order_list()


{
int i, num, num2;
bool found;
system("cls");
node *temp;

temp=start_ptr;


found = false;
cout<<" Chekni chop qilish uchun chek raqamini kiriting \n";
cin>>num2;
cout<<"\n";
cout<<"==========================================================================="<cout <<"\t\tBu yerde buyurtmalar tarixi\n";
cout<<"==========================================================================="<if(temp == NULL)
{
cout << "\tBuyurtmalar yo’q\n\t\t\tShuning uchun ro’yxat bo’sh\n\n\n";
}
while(temp !=NULL && !found)
{
if (temp->reciept_number==num2)
{
found = true;
}
else
{
temp = temp -> next;
}
if (found)
{
cout <<"Chek raqami : "<reciept_number;
cout <<"\n";
cout<<"Mijoz ismi: "<customerName<cout<<"Buyurtma sanasi : "<date<cout<<"_____________________________________________________________________________"<cout << "===============================================================================" << endl;
cout << "| DORI TURI | DORI NOMI | MIQDORI | JAMI NARXI |" << endl;
cout << "=======++==================++================++===============++===============" << endl;
for (i=0;ix;i++)
{
cout << temp->type <<" \t\t";
cout<medicineName[temp->menu2[i]-1]<<"\t\t\t ";
cout<quantity[i] <<"\t\t";
cout<< temp->amount[i]<<" SO’M "<cout<<"_________________________________________________________________________________"<}
temp->total = temp->amount[0]+temp->amount[1]+temp->amount[2]+temp->amount[3]+temp->amount[4]+temp->amount[5]+temp->amount[6]+temp->amount[7]
+temp->amount[8]+temp->amount[9];
cout<<"Umumiy hisob : "<total;
cout<<"\n";
cout << "To’lashingiz kerak bo’lgan miqdorni kiriting: ";
cin >> num;

cout <<"\n";


cout <<"\n";
cout<<"To’lov amalga oshirildi :)\nRAHMAT\n";
cout <<"\n_______________________________________________________________________________\n";
}
}
}
void medicineType::delete_order()
{
system("cls");
int i, num, count;
cout<<"O’chirmoqchi bo’lgan ma’lumotingizni kiriting \n";
cin>>num;
node *q;
node *temp;
bool found;

if(start_ptr == NULL)


cerr<<"Bo’sh ro’yxatdan o’chirib bo’lmaydi!\n";
else
{
if(start_ptr->reciept_number == num)
{
q = start_ptr;
start_ptr = start_ptr->next;
count--;
if(start_ptr == NULL)
last = NULL;
delete q;
cout<<"Kvitansiya muvaffiqiyatli o’chirildi. "<}
else
{
found = false;
temp = start_ptr;
q = start_ptr->next;
while((!found) && (q != NULL))
{
if(q->reciept_number != num)
{
temp = q;
q = q-> next;
}
else
found = true;
}

if(found)


{
temp->next = q->next;
count--;

if(last == q)


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");
}

cout<<"O'ZGARTIRILDI....!"<
}
else
{
if(temp != NULL && temp->reciept_number != sid)
{
cout<<"Yaroqsiz kvitansiya raqami...!"<}
}
}
}
}

void medicineType::daily_summary()


{
int i,num;
system("cls");
node *temp ;

temp=start_ptr;


if(temp == NULL)
{
cout << "\t\t\tKo'rsatish uchun buyurtma yo'q\n\t\t\tRo'yxat bo'sh\n\n\n";
}
else
{
cout<<"\n";
cout<<"==========================================================================="<cout <<" \t\t Barcha buyurtmalarning kunlik xulosasi \n";
cout<<"==========================================================================="<

while(temp!=NULL)


{
cout <<"Chek raqami : "<reciept_number;
cout <<"\n";
cout<<"Mijoz ismi: "<customerName<cout<<"Buyurtma sanasi : "<date<cout<<"____________________________________________________________________________"<cout << "==========================================================================" << endl;
cout << "| DORI TURI | DORI NOMI | MIQDORI | JAMI NARXI |" << endl;
cout << "=======++==================++================++===============++==========" << endl;
for (i=0;ix;i++)
{
cout << temp->type <<" \t\t";
cout<medicineName[temp->menu2[i]-1]<<"\t\t";
cout<quantity[i] <<"\t\t";
cout<< temp->amount[i]<<" SO'M"<cout<<"_____________________________________________________________________________"<}
temp->total = temp->amount[0]+temp->amount[1]+temp->amount[2]+temp->amount[3]+temp->amount[4]+temp->amount[5]+temp->amount[6]+temp->amount[7]
+temp->amount[8]+temp->amount[9];
cout<<"Umumiy hisob: "<total;
cout <<"\n";
cout <<"\n";
cout <<"\n_______________________________________________________________________________\n";
temp=temp->next;
}
}
}
void medicineType::exit()
{
cout<<"\nSiz chiqishni tanladingiz...\n"<system("pause");
}





Download 0,89 Mb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish