Shomurodov Yaxshiboy di 11 19 guruh talabasi


Download 13.7 Kb.
Sana13.12.2020
Hajmi13.7 Kb.
#165962
Bog'liq
labaratorya 1





  1. Shomurodov Yaxshiboy DI 11 19 guruh talabasi

Mahsulot nomlaridan iborat elementlar va ularning qiymati sifatida narxlari kiritilgan sanaladigan toifa yarating. So‘ralayotgan narxda qanday mahsulot yoki mahsulotlar to‘plamini xarid qilsa bo‘ladi, shuni aniqlash dasturini tuzing.

#include

#include

using namespace std;

int main(){

int g; bool t=true;

while(t){

cout<<" 1 ) SOVUNLAR"<

cout<<" 2 ) uyinchoqlar"<

cout<<" 3 ) mevalar"<

cout<<" 4 ) boshqa narsalar"<

cout<<" 5 ) chiqish"<

cout<<" komandani tanlang"<

cin>>g;

switch(g){



case 1: {

cout<<"1) palmoliv 10000 "<

cout<<"2 ) olive 6000 "<

cout<<"3) kir sovun 3000"<

cout<<" komandani tanlang"<

int k;


cin>>k;

switch(k){

case 1:

cout<<" siz palmoliv sotib oldigiz haridigiz uchun rahmat !!! "<

case 2:

cout<<" siz olive sotib oldigiz haridigiz uchun rahmat !!! "<

case 3:

cout<<" siz kir sovun sotib oldigiz haridigiz uchun rahmat !!! "<

default: cout<<" yuq"; break;

}

} break;



case 2:

{

cout<<" 1) moshincha 30000"<

cout<<"2) jep moshina 28000"<

cout<<"3) pistalit 20000"<

int u;

cin>>u;


switch(u){

case 1: cout<<"siz moshincha sotib oldigiz haridigiz uchun rahmat !!!! "<

case 2: cout<<"siz jep moshinna sotib oldigiz haridigiz uchun rahmat !!!! "<

case 3: cout<<"siz pistalit sotib oldigiz haridigiz uchun rahmat !!!! "<

default : cout<<" yuq";

}

} break;



case 3:

{

cout<<" 1) Olma 13 000 "<

cout<<" 2) mandarin 32 000" <

cout<<" 3) banan 25 000"<

cout<<" 4) KIVI 40 000"<

int m;


cin>>m;

switch(m){

case 1: cout<<"siz olma sotib oldigiz haridigiz uchun rahmat !!!! "<

case 2: cout<<"siz mandarin sotib oldigiz haridigiz uchun rahmat !!!! "<

case 3: cout<<"siz bana sotib oldigiz haridigiz uchun rahmat !!!! "<

case 4: cout<<"siz KIVI sotib oldigiz haridigiz uchun rahmat !!!! "<

default : cout<<" yuq" ; break;

}

} break;



case 4:

{

cout<<" 1 ) NON 3 000"<

cout<<" 2 ) pichini 30 000"<

cout<<" 3 ) konfet 22 000"<

cout<<" 4 ) kango 1000 "<

cout<<" 5 ) orbit 5000"<

int p;

cin>>p;


switch(p){

case 1: cout<<"siz NON sotib oldigiz haridigiz uchun rahmat !!!! "<

case 2: cout<<" siz PICHINIsotib oldigiz haridigiz uchun rahmat !!!! "<

case 3: cout<<"siz KONFET sotib oldigiz haridigiz uchun rahmat !!!! "<

case 4: cout<<"siz KANGO sotib oldigiz haridigiz uchun rahmat !!!! "<

case 5: cout<<"siz ORBIT sotib oldigiz haridigiz uchun rahmat !!!! "<

default : cout<<" yuq:";break;

}

} break;



case 5:

t=false;


break;

default : cout<<"yuq";break;

}

char q;


q=getchar();

q=getchar();

system("cls");

return 0;



}

}
Download 13.7 Kb.

Do'stlaringiz bilan baham:




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