Baxodirov Samandar 4-Labaratoriya


Download 56.34 Kb.
Sana16.06.2023
Hajmi56.34 Kb.
#1499645
Bog'liq
Samandar 415


Baxodirov Samandar 4-Labaratoriya
# include
# include
# include
# include
using namespace std;
class nout{
private:
char name [20];
char firm [20];
public:
int op_x;
int ozu;
int xot;
int narx;
void kirit(){
cout<<"Nomi: ";cin>>name;
cout<<"Ishlab chiqarilgan firma: "; cin>>firm;
cout<<"operativ xotirasi: ";cin>>op_x;
cout<<"Ozusi: ";cin>>ozu;
cout<<"Xotirasi ";cin>>xot;
cout<<"Narxi: ";cin>>narx;
}
void qidirish(char nomi[20]){
if(strcmp(name, nomi)==0){
cout<<"Nomi: "< cout<<" Xotira: "< cout<<"Firma: "< cout<<"Narxi: "< }
}
void show(){
cout<<"Nomi: "< cout<<" Xotira: "< cout<<"Firma: "< cout<<"Narxi: "< cout<<"_____________________\n\n";
}
};
int main(){
nout *t;
int n; cout<<"Noutbook soni: "; cin>>n;
t=new nout[n];
for(int i=1; i {
cout< t[i].kirit();

}
Malika:
int oper_xotira;
int tanlov;
char nom[20];
int pul;
bool z=true;
char javob[10];
cout<<"\n\n\n\n\n\n\nMenyu: \n\n";
cout<<"1. Nomi bo'yicha qidirish\n";
cout<<"2. Doimiy xotirasi bo'yicha qidirish\n";
cout<<"3. Operativ xotirasi bo'yicha qidirish\n";
cout<<"4. Ozusi bo'yicha qidirish\n";
cout<<"5. Narxini O'zgartirish\n";
cout<<"6. Yuqoridagilardan birini tanlang\n";
cin>> tanlov;
switch(tanlov){
case 1:
cout<<" Siz qidirayotgan noutbook nomini kiriting:" ; cin>>nom;
for(int i=1; i<=n ; i++)
{t[i].qidirish(nom);} break;
case 2:
for(int i=1; i<=n; i++){
for(int j=i+1; j<=n; j++)
if(t[i].ozu>t[j].ozu) swap(t[i],t[j]);
}
for(int i=1; i<=n ; i++){
t[i].show();
}
break;
case 3:
cout<<"Sizga kerakli operativ xotirani kiriting: ";
for(int i=1; i<=n ; i++){
if(t[i].op_x==oper_xotira){t[i].show(); z== false;}
if(z>=true)cout<<"Bizning dokonda "< break;}
case 4:
cout<<"Qancha pulingiz mavjud: "; cin>> pul;
for(int i=1; i<=n ; i++){
if(t[i].narx<=pul) {t[i].show(); z=false;}
if(z==true){
} cout<<"Bu narxdagi noubooklar tugagan \n";
break;}
case 5:
cout<<" Dokonimizda skidka 35%\n";
for(int i=1; i<=n; i++)
{
t[i].narx=(t[i].narx*0.7);
}
for(int i=1; i<=n; i++)

t[i].show();
cout< break;
default: cout<<"Menyuga qarab son kiriting \n\n";
}
cout<<" Boshiga qaytasizmi?(xa, yo'q)";
if(strcmp(javob,"xa")==0) goto Malika;
else {getch();
return 0;
} }

Download 56.34 Kb.

Do'stlaringiz bilan baham:




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