Telekommunikatsiya texnologiyalar
Download 269.82 Kb.
|
Alimardon5
- Bu sahifa navigatsiya:
- DASTURLASH I
MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKEMT AXBOROT TEXNOLOGIYALARI UNIVERSITETI “TELEKOMMUNIKATSIYA TEXNOLOGIYALAR” yo’nalishi 415_22 guruh talabasi Xaydaraliyev Alimardonning “DASTURLASH I” fanidan tayyorlagan Amaliy ishi O’qituvchi: Saidov Samandar Toshkent – 2022 22-VARIANT 1-Topshiriq
Kod:
private: string name, familya; int fan1,fan2,fan3,fan4,fan5; public: Gurux(){ }; Gurux(string name, string familya, int fan1, int fan2, int fan3, int fan4, int fan5){ this -> name = name; this -> familya = familya; this -> fan1 = fan1; this -> fan2 = fan2; this -> fan3 = fan3; this -> fan4 = fan4; this -> fan5 = fan5; }; int get_uch(){ if(fan1==3 || fan2==3 || fan3==3 || fan4==3 || fan5==3){ return 1; }else return 0; } void get_All(){ cout <<"Ism -> "<
int main(){ int n, fan1, fan2, fan3, fan4, fan5; string name,familya; cout <<"Nechta o'quvchi kiritmoqchisiz: "; cin>>n; Gurux *gurux = new Gurux[n]; int arr[n], c=0; for(int i=0; i cout <<"Familyasi -> "; cin >>familya; cout <<"1-fan bahosi: "; cin >>fan1; cout <<"2-fan bahosi: "; cin >>fan2; cout <<"3-fan bahosi: "; cin >>fan3; cout <<"4-fan bahosi: "; cin >>fan4; cout <<"5-fan bahosi: "; cin >>fan5; gurux[i] = Gurux(name,familya,fan1,fan2,fan3,fan4,fan5); if(gurux[i].get_uch()==1){ arr[c] = i; c++; } } cout < return 0; } Natija: 2-Topshiriq
Kod:
using namespace std; class Phone{ private: string model, marka, ram, year; public: Phone(){ }; Phone(string model, string marka, string ram, string year){ this -> model = model; this -> marka = marka; this -> ram = ram; this -> year = year; }; void get_All(){ cout <<"Telefon markasi -> "< }; int main(){ Phone *phone = new Phone[3]; string arr[3][4] = {{"Iphone","12 pro","6","2020"},{"Galaxy","s10 plus","12","2018"},{"Redmi","12 lite","8","2021"}}; for(int i=0; i<3; i++){ phone[i] = Phone(arr[i][0],arr[i][1],arr[i][2],arr[i][3]); phone[i].get_All(); } return 0; } Natija: Download 269.82 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling