Telekommunikatsiya texnologiyalar


Download 269.82 Kb.
Sana02.01.2023
Hajmi269.82 Kb.
#1075603
Bog'liq
Alimardon5





MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKEMT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

“TELEKOMMUNIKATSIYA


TEXNOLOGIYALAR” yo’nalishi 415_22 guruh talabasi
Xaydaraliyev Alimardonning “DASTURLASH Ifanidan tayyorlagan
Amaliy ishi
O’qituvchi:
Saidov Samandar

Toshkent – 2022 22-VARIANT
1-Topshiriq

1.

Guruxdagi o’quvchilarning familiyasi, ismi va 5 ta fandan olgan baxolari to’g’risida ma’lumotlar berilgan. Hech bo’lmaganda bitta fandan 3 baxosi bor bo’lgan o’quvchilarning ro’yxatini chop etuvchi dastur tuzing. Hisobot
mazmuni 1. Titul varaqasi: Fan nomi, ish mavzusi, talaba ismi sharifi

Kod:
#include using namespace std; class Gurux{


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 -> "<cout <<"Familya -> "<

cout
"<

<<"1-fan

bahosi

->

cout
"<

<<"2-fan

bahosi

->

cout
"<

<<"3-fan

bahosi

->

cout

<<"4-fan

bahosi

->

"<cout



<<"5-fan

bahosi


->


"<}










};










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; icout < "; cin >>name;
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 <cout <<"Guruxda kamida bitta 3 bahosi bor o'quvchilar: "<for(int i=0; i}
return 0;
}
Natija:


2-Topshiriq


Telefon (Markasi, modeli, tezkor xotiraning hajmi, ishlab chiqarilgan yili)

Markasi

Kod:
#include


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 -> "<cout <<"Telefon modeli -> "<cout <<"Tezkor xotirasi -> "<cout <<"Chiqarilgan yili -> "<cout <}
};
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