Dasturlash 2” fanidan tayyorlagan 1-Amaliy ishi O’qituvchi
Download 20.2 Kb.
|
Sevda 22
- Bu sahifa navigatsiya:
- DASTURLASH I”
“AKT sohasida kasb ta’limi” yo’nalishi 651-22 guruh talabasi HAYITBOYEVA SEVDOning “DASTURLASH 2” fanidan tayyorlagan 1-Amaliy ishi O’qituvchi: Shabdorov Elbek “AKT sohasida kasb ta’limi” yo’nalishi 651-22 guruh talabasi HAYITBOYEVA SEVDOning “DASTURLASH I” fanidan tayyorlagan 1-Amaliy ishi O’qituvchi: 1-Topshiriq. 21-Variant 21.Tufli va tapichka class larini yarating va ularni bog’lovchi funksiyalar yarating. Kodi: #include using namespace std; class tufli { public: int nomer; char rangi[15]; int narxi; void print() { cout< } }; class tapichka { public: int nomer; char nomi[10]; char rangi[20]; int narxi; void print1() { cout< } }; int main() { tufli a[20];int i,k; tapichka b[20];int j,l; cout<<"Nechta tufli haqida malumot kiritasiz?:";cin>>k; for(i=0;i { cout<<"nomer:\t";cin>>a[i].nomer; cout<<"hajmi:\t";cin>>a[i].rangi; cout<<"narxi:\t";cin>>a[i].narxi; } cout<<"tuflilar ro'yxati"< cout<<"nomer\t"<<"rangi\t"<<"narxi $\t"< for(i=0;i { a[i].print();cout< } cout< cout< cout<<"Nechta tapichka haqida malumot kiritasiz?:"; cin>>l; for(j=0;j { cout<<"nomer:\t";cin>>b[j].nomer; cout<<"nomi:\t";cin>>b[j].nomi; cout<<"rangi:\t";cin>>b[j].rangi; cout<<"narxi:\t";cin>>b[j].narxi; } cout<<"tapichka ro'yxati:"< cout<<"nomer\t"<<"nomi\t"<<"rangi\t"<<"narxi $\t"< for(j=0;j<1;j++) { b[j].print1();cout< } return 0; } Natijasi: 21 Ro’yxatdagi eng kichik elementini toping. Kodi: #include #include using namespace std; int main() { int i; array int min=a.front(); for(int i:a){ if(min>i) min=i; else min=min; } cout< } Natijasi: Download 20.2 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling