Cho’liyev. Sh tekshirdi: Gulyamova. D 1-Topshiriq Printer



Yüklə 400,32 Kb.
tarix06.05.2023
ölçüsü400,32 Kb.
#108492
4-Lobaratoriya


MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

431-21-guruh talabasi Zayniddinov Najmiddinning dasturlash fanidan lobaratoriya ishi

Tekshirdi: Cho’liyev.SH
Tekshirdi: Gulyamova.D
1-Topshiriq
Printer va skanner class larini yarating va ularni bog’lovchi funksiyalar yarating

class Printer{
public:
string nomi;
string modeli;
int narxi;
};
prin(){
Printer print;
print.nomi="Canon";
print.modeli="ImageClass MF3010";
print.narxi=150;

cout<<"Printerni nomi "<
}
class Skaner{
public:
string nomi;
string modeli;
int narxi;
};
skan(){
Skaner skan;
skan.nomi="NAPS";
skan.modeli="26.1.2";
skan.narxi=100;

cout<<"Skaner nomi "<}
itog(){
cout<<" hammasini narhi ";
cout<<205<<"$";
}
int main(){
int j;
cout << "nima olmoqchisiz (printer=1 yoki skaner=2)"; cin>>j;
if(j==1){
prin();
} else if(j==2){
skan();
} else if (j==1,2){
prin();
skan();
itog();
}
}

.Uchburchak sinfini yarating. Unda kamida 5 ta maydon va ularni ekranga chiqaruvchi, qayta ishlovchi usullarni yarating.



class Uchburchak{
public:
string turi;
int tomoni;
int burchagi;
int balandligi;
};
int main(){
Uchburchak uchbur1, uchbur2, uchbur3;

uchbur1.turi = " togri burchakli ";


uchbur1.tomoni=15;
uchbur1.burchagi= 36;
uchbur1.balandligi=20;

cout<<"uchburchakni turi "< cout<<"uchburchakni tomoni "<cout<<"uchburchakni burchagi "< cout<<"uchburchakni balandligi "<uchbur2.turi="teng tomonli ";


uchbur2.tomoni=15 ;
uchbur2.burchagi=25 ;
uchbur2.balandligi=30;

cout<<"uchburchakni turi "< cout<<"uchburchakni tomoni "< cout<<"uchburchakni burchagi "< cout<<"uchburchakni balandligi "<uchbur3.turi="otkir burchakli ";


uchbur3.tomoni=20;
uchbur3.burchagi=35;
uchbur3.balandligi=23;

cout<<"uchburchakni turi "< cout<<"uchburchakni tomoni "< cout<<"uchburchakni burchagi "< cout<<"uchburchakni balandligi "<}

.Firmaning xodimlari to’g’risida quyidagi ma’lumotlar ma’lum: Familiyasi, ismi, jinsi, farzandi (bor yoki yo’q) haqida ma’lumot berilgan. Farzandi bo’lgan ayol xodimlar ro’yxatini chop etuvchi dastur tuzing.



class ishchilar
{
public:
string familyasi;
string ismi;
string jinsi;
string farzand;
int yoshi;
int ish_haqqi;

};
int main() {


ishchilar ob1, ob2, ob3, ob4, ob5;
ob1.familyasi = "xojimurodova";
ob1.ismi = "Dilfuza";
ob1.jinsi = "Ayol";
ob1.yoshi = 17;
ob1.farzand = "yoq";
ob1.ish_haqqi = 500;

ob2.familyasi = "Mirzayev";


ob2.ismi = "Donyor";
ob2.jinsi = "Erkak";
ob2.yoshi = 18;
ob2.farzand = "yoq";
ob2.ish_haqqi = 100;

ob3.familyasi = "Juraboyeva";


ob3.ismi = "Mushtari";
ob3.jinsi = "Ayol";
ob3.yoshi = 18;
ob3.farzand = "yoq";
ob3.ish_haqqi = 50;

ob4.familyasi = " Yusupova";


ob4.ismi = " Muxlisa";
ob4.jinsi = "Ayol";
ob4.yoshi = 25;
ob4.farzand = "Bor";
ob4.ish_haqqi = 400;

ob5.familyasi = "Abdusalomova";


ob5.ismi = "Maftuna";
ob5.jinsi = "Ayol";
ob5.yoshi = 18;
ob5.farzand = "yoq";
ob5.ish_haqqi = 300;

cout << "ishchinig familyasi " << ob1.familyasi << endl;


cout << "ismi " << ob1.ismi << endl;
cout << "jinsi " << ob1.jinsi << endl;
cout << "ish haqqi " << ob1.ish_haqqi << "$" << endl;
cout << "ishchinig yoshi " << ob1.yoshi << endl;
cout << "ishchining farzandi " << ob1.farzand << endl;

cout << endl;

cout << "ishchinig familyasi " << ob2.familyasi << endl;
cout << "ismi " << ob2.ismi << endl;
cout << "jinsi " << ob2.jinsi << endl;
cout << "ish haqqi " << ob2.ish_haqqi << "$" << endl;
cout << "ishchinig yoshi " << ob2.yoshi << endl;
cout << "ishchining farzandi " << ob2.farzand << endl;
cout << endl;

cout << "ishchinig familyasi " << ob3.familyasi << endl;


cout << "ismi " << ob3.ismi << endl;
cout << "jinsi " << ob3.jinsi << endl;
cout << "ish haqqi " << ob3.ish_haqqi << "$" << endl;
cout << "ishchinig yoshi " << ob3.yoshi << endl;
cout << "ishchining farzandi " << ob3.farzand << endl;
cout << endl;

cout << "ishchining familyasi " << ob4.familyasi << endl;


cout << "ismi " << ob4.ismi << endl << endl;
cout << "jinsi " << ob4.jinsi << endl;
cout << "ish haqqi " << ob4.ish_haqqi << "$" << endl;
cout << "ishchinig yoshi " << ob4.yoshi << endl;
cout << "ishchining farzandi " << ob4.farzand << endl;
cout << endl;

cout << "ishchinig familyasi " << ob5.familyasi << endl;


cout << "ismi " << ob5.ismi << endl;
cout << "jinsi " << ob5.jinsi << endl;
cout << "ish haqqi " << ob5.ish_haqqi << "$" << endl;
cout << "ishchinig yoshi " << ob5.yoshi << endl;
cout << "ishchining farzandi " << ob5.farzand << endl;
cout << endl;
int far, a[5] = {ob1.farzand, ob2.farzand, ob3.farzand, ob4.farzand, ob5.farzand }
for (int i = 0; i <= 4; i++) {

if (a[5]{ob1.farzand ==="Bor" || ob2.farzand ==="Bor" || ob3.farzand ==="Bor" || ob4.farzand ==="Bor" || ob5.farzand ==="Bor"}){

far= a[i];


cout << "farzandi bori" << far;
}
}
return 0;

}
Yüklə 400,32 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin