cout << "Familyasi: " << h.familyasi << endl;
cout << "Ismi: " << h.ismi << endl;
cout << "Haridorning uy manzili: " << h.haridorning_uy_manzili << endl;
}
int main() {
Haridorlar_haqida k, l;
cout << "Tartib raqami: "; cin >> k.tartib_raqami;
cout << "Familyasi: "; cin >> k.familyasi;
cout << "Ismi: "; cin >> k.ismi;
cout << "Haridorning uy manzili: "; cin >> k.haridorning_uy_manzili;
cout << "Tartib raqami: "; cin >> l.tartib_raqami;
cout << "Familyasi: "; cin >> l.familyasi;
cout << "Ismi: "; cin >> l.ismi;
cout << "Haridorning uy manzili: "; cin >> l.haridorning_uy_manzili;
if ((k.familyasi == l.familyasi) && (l.ismi==k.ismi)) {
delete[]k.familyasi;
delete[]k.ismi;
delete []k.haridorning_uy_manzili;
}
print(k);
print(l);
return 0;
}
####################################################################
2. Tovarlar ro’yxati quyidagilardan iborat. Tovar nomi, tovar miqdori, narxi va tovarning omborga kelib tushgan vaqti. Narxi 10000 so’mdan oshiq va bir oydan ko’proq saqlanayotgan tovarlar ro’yxatini chiqarish.
####################################################################
#include
using namespace std;
class Tovarlar_ruyxati {
public:
friend void print(Tovarlar_ruyxati h);
char tovar_nomi[30];
int tovar_miqdori;
int narxi;
int tovarning_omborga_kelib_tushgan_vaqti;
};
void print(Tovarlar_ruyxati h) {
if ((h.narxi > 10000) && (h.tovarning_omborga_kelib_tushgan_vaqti > 30)) {
cout << "Tovar nomi: " << h.tovar_nomi << endl;
}
else {
cout << "Bunday tovar yo'q!";
}
}
int main() {
Tovarlar_ruyxati k, l;
cout << "Tovar nomi: "; cin >> k.tovar_nomi;
cout << "Tovar miqdori: "; cin >> k.tovar_miqdori;
cout << "Narxi: "; cin >> k.narxi;
cout << "Tovarning omborga kelib tushgan vaqti: "; cin >> k.tovarning_omborga_kelib_tushgan_vaqti;
cout << "Tovar nomi: "; cin >> l.tovar_nomi;
cout << "Tovar miqdori: "; cin >> l.tovar_miqdori;
cout << "Narxi: "; cin >> l.narxi;
cout << "Tovarning omborga kelib tushgan vaqti: "; cin >> l.tovarning_omborga_kelib_tushgan_vaqti;
print(k);
print(l);
return 0;
}
####################################################################
3. Firmaning xodimlarining to’g’risida (familiya, ismi, ish haqi, jinsi) ma’lumot mavjud. Eng yuqori maosh oluvchi ayol haqida ma’lumotlarni chiqaring.
####################################################################
#include
using namespace std;
class Firmaning_xodimlari {
public:
friend void print(Firmaning_xodimlari h);
char familiyasi[30];
char ismi[30];
int ish_haqi;
char jinsi[10];
};
void print(Firmaning_xodimlari h) {
if ((h.jinsi == "Ayol")&&(h.ish_haqi>1000000)) {
cout << h.familiyasi << " " << h.ismi;
}
}
int main() {
Firmaning_xodimlari k, l;
cout << "Xodim familiyasi: "; cin >> k.familiyasi;
cout << "Xodim ismi: "; cin >> k.ismi;
cout << "Ish haqi: "; cin >> k.ish_haqi;
cout << "Xodim jinsi: "; cin >> k.jinsi;
cout << "Xodim familiyasi: "; cin >> l.familiyasi;
cout << "Xodim ismi: "; cin >> l.ismi;
cout << "Ish haqi: "; cin >> l.ish_haqi;
cout << "Xodim jinsi: "; cin >> l.jinsi;
print(k);
print(l);
return 0;
}
####################################################################
4. Firmaning xodimi xaqida quyidagi ma’lumotlar mavjud: familiyasi, ismi, yoshi, xarbiy xizmatga layoqatligi. Shu ma’lumotlarga asoslanib, xarbiy xizmatga layoqatli eng yosh xodimning familiyasini aniqlash dasturini tuzing.
####################################################################
#include
using namespace std;
class Firmaning_xodimlari {
public:
friend void print(Firmaning_xodimlari h);
char familiyasi[30];
char ismi[30];
int yoshi;
char jinsi[10];
char xarbiy_xizmatga_layoqatligi[20];
};
void print(Firmaning_xodimlari h) {
if ((h.xarbiy_xizmatga_layoqatligi == "Layoqatli") && (h.yoshi<22)) {
cout << h.familiyasi << " " << h.ismi;
}
}
int main() {
Firmaning_xodimlari k, l;
cout << "Xodim familiyasi: "; cin >> k.familiyasi;
cout << "Xodim ismi: "; cin >> k.ismi;
cout << "Xodim yoshi: "; cin >> k.yoshi;
cout << "Xarbiy xizmatga layoqatligi: "; cin >> k.xarbiy_xizmatga_layoqatligi;
cout << "Xodim familiyasi: "; cin >> l.familiyasi;
cout << "Xodim ismi: "; cin >> l.ismi;
cout << "Xodim yoshi: "; cin >> l.yoshi;
cout << "Xarbiy xizmatga layoqatligi: "; cin >> l.xarbiy_xizmatga_layoqatligi;
print(k);
print(l);
return 0;
}
####################################################################
5. Firma xodimining familiyasi, ismi va manzili mavjud. Xodimlar orasida Abdullaev, Abduazizov, Abdualimov familiyali xodimlar borligini aniqlang, Agar shu familiyali odam bo’lsa, ularning ro’yxatini chop etuvchi bo’lmasa yo’qligi haqida habar chiqaruvchi dastur tuzing.
####################################################################
#include
using namespace std;
class Firmaning_xodimlari {
public:
friend void print(Firmaning_xodimlari h);
char familiyasi[30];
char ismi[30];
char manzili[30];
};
void print(Firmaning_xodimlari h) {
if (h.familiyasi == "Abdullaev" || h.familiyasi == "Abduazizov" || h.familiyasi == "Abdualimov") {
cout << h.familiyasi << " " << h.ismi << endl;
}
}
int main() {
Firmaning_xodimlari k, l;
cout << "Xodim familiyasi: "; cin >> k.familiyasi;
cout << "Xodim ismi: "; cin >> k.ismi;
cout << "Xodim manzili: "; cin >> k.manzili;
cout << "Xodim familiyasi: "; cin >> l.familiyasi;
cout << "Xodim ismi: "; cin >> l.ismi;
cout << "Xodim manzili: "; cin >> l.manzili;
print(k);
print(l);
return 0;
}
####################################################################
6. Guruxdagi o’quvchilarning familiya, ismi va bo’yining uzunligi ma’lum. Ushbu ma’lumotlarga asoslanib, eng bo’yi baland va eng bo’yi past o’quvchining familiyasini chop etuvchi dastur tuzing.
####################################################################
#include
using namespace std;
class Guruh_haqida {
public:
friend void print(Guruh_haqida h);
char familiyasi[30];
char ismi[30];
int uzunligi;
};
void print(Guruh_haqida h) {
if (h.uzunligi > 160) {
cout << h.familiyasi << " " << h.ismi << endl;
}
}
int main() {
Guruh_haqida k, l;
cout << "O'quvchi familiyasi: "; cin >> k.familiyasi;
cout << "O'quvchi ismi: "; cin >> k.ismi;
cout << "O'quvchining bo'yini uzunligi: "; cin >> k.uzunligi;
cout << "O'quvchi familiyasi: "; cin >> l.familiyasi;
cout << "O'quvchi ismi: "; cin >> l.ismi;
cout << "O'quvchining bo'yini uzunligi: "; cin >> l.uzunligi;
print(k);
print(l);
_getwch();
return 0;
}
####################################################################
7. Yotoqxonadan joy olish uchun talabalar ro’yxati tuziladi, unda talabaning familiyasi, ismi, o’rtacha balli, oila a’zolarining daromadidan iborat. Yotoqxona berilishi uchun ro’yhatda birinchi navbatda oila a’zolarining daromadi ikki minimal maoshdan kam bo’lgan talabalar kiritiladi, so’ngra bu ro’yxat talabalarni o’rtacha balining kamayishini tartibda ketadi. Yotoqxona joylarining berilish navbatining ro’yxatini chiqarish.
####################################################################
####################################################################
8. Guruxdagi o’quvchilarning familiyasi, ismi, tug’ilgan yili va oyi, sanasi xaqida ma’lumot berilgan. Bahorda tug’ilgan o’quvchilar ro’yxatini chop etuvchi dastur tuzing.
####################################################################
####################################################################
9. Guruxdagi o’quvchilarning familiyasi, ismi ma’lum bo’lsa, “A” va “N” xarfi bilan boshlanuvchi o’quvchilarning ro’yxatini chop etuvchi dastur tuzing.
####################################################################
####################################################################
10. Bir necha xil yengil avtomobillar nomi, markalari va ularning narxlari berilgan. Ulardan narxi 60 mln va 80 mln oraliqdagi narxli avtomobil haqidagi ma’lumotlarni chop etuvchi dastur tuzing.
####################################################################
####################################################################
11. Guruxdagi o’quvchilarning familiyasi, ismi, va 5 ta fandan olgan baxolari ma’lum. Xar bir o’quvchining va guruxning fanlar bo’yicha o’rtacha baxosini aniqlash va o’rtacha baxosi gurux o’rtachasidan yuqori bo’lgan o’quvchilar ro’yxatini chop etish dasturini tuzing.
####################################################################
####################################################################
12. O’qituvchilarning familiyasi va telefon raqami yozilgan. Biror telefon raqami bo’yicha uning egasini familiyasini va aksincha familiya berilsa, uning telefon raqamini chop etuvchi dastur tuzing.
####################################################################
####################################################################
13. Firmaning xodimlar to’g’risida quyidagi ma’lumotlar ma’lum: Familiyasi, ismi, oilaviy axvoli (turmush qurgan yoki yo’q ), farzandi (bor yoki yo’q) haqida ma’lumot berilgan. Farzandi bo’lgan xodimlar ro’yxatini chop etuvchi dastur tuzing.
####################################################################
####################################################################
14. Firmada ishlovchi xodimlarning familiyasi, ismi va ishga qabul qilingan sanasi (oy,yil) berilgan. Shu firmada 3 yildan ortiq vaqtdan beri ishlayotgan xodimlarning familiyasi, ismini chop etuvchi dastur tuzing.
####################################################################
####################################################################
15. Kafedrada ishlovchi o’qituvchilarning familiyasi, ismi va telefoni (agar bo’lsa bo’lmasa “yo’q” yoziladi) to’g’risida ma’lumot berilgan. Telefoni yo’q bo’lgan o’qituvchilar ro’yxatinini chop etuvchi dastur tuzing.
####################################################################
####################################################################
16. Guruxdagi o’quvchilarning familiyasi, ismi, tug’ilgan yili va oyi, sanasi xaqida ma’lumot berilgan. Kuzda tug’ilgan o’quvchilar ro’yxatini chop etuvchi dastur tuzing.
####################################################################
####################################################################
17. 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.
####################################################################
####################################################################
18. Guruxdagi o’quvchilarning familiyasi, ismi va 5 ta fandan olgan baxolari to’g’risida ma’lumotlar berilgan. Qarzdorlar ro’yxatini chop etuvchi dastur tuzing.
####################################################################
####################################################################
19. Har xil yengil avtomobillar nomi, markalari va ularning narxlari berilgan. Ulardan hairdo tomonidan kiritilgan nomli avtomobillar haqida ma’lumotni chop etuvchi dastur tuzing.
####################################################################
####################################################################
20. Do’konda sotuvga tushgan avtomobillar ro’yxati mavjud. Bu ro’yxatning har bir yozuvi quyidagicha: avtomobil markasi, narxi, 100 km uchun yoqilg’i harajati. Xaridor tomonidan kiritilgan markali avtomobillar ro’yxatini chiqarish.
####################################################################
####################################################################
21. Bokschilar ro’yhati berilgan: bokschining familiyasi, ismi, vazni. 55 kg vazngacha bo’lgan bokschilar ro’yhatini chiqaring.
####################################################################
####################################################################
22. 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
####################################################################
####################################################################
3-jadval:
1. Kitob (Avtor, kitob nomi, nashriyot, sahifalar soni) --- nashriyoti
####################################################################
#include
using namespace std;
class Kitob {
public:
char Avtor[30];
char Kitob_nomi[30];
char Nashriyot[30];
int Sahifalar_soni;
friend void set(Kitob k);
};
void set(Kitob k) {
cout << k.Nashriyot << endl;
}
int main() {
Kitob l, k, j;
cout << "Avtor: "; cin >> l.Avtor;
cout << "Kitob nomi: "; cin >> l.Kitob_nomi;
cout << "Nashriyot: "; cin >> l.Nashriyot;
cout << "Sahifalar soni: "; cin >> l.Sahifalar_soni;
cout << "Avtor: "; cin >> k.Avtor;
cout << "Kitob nomi: "; cin >> k.Kitob_nomi;
cout << "Nashriyot: "; cin >> k.Nashriyot;
cout << "Sahifalar soni: "; cin >> k.Sahifalar_soni;
cout << "Avtor: "; cin >> j.Avtor;
cout << "Kitob nomi: "; cin >> j.Kitob_nomi;
cout << "Nashriyot: "; cin >> j.Nashriyot;
cout << "Sahifalar soni: "; cin >> j.Sahifalar_soni;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
2. Avtomobil (Markasi, rangi, modeli, ishlab chiqarilgan yili)---modeli
####################################################################
#include
using namespace std;
class Avtomobil {
public:
char Markasi[30];
char Rangi[30];
char Modeli[30];
int Ishlab_chiqarilgan_yili;
friend void set(Avtomobil k);
};
void set(Avtomobil k) {
cout << k.Modeli << endl;
}
int main() {
Avtomobil l, k, j;
cout << "Markasi: "; cin >> l.Markasi;
cout << "Rangi: "; cin >> l.Rangi;
cout << "Modeli: "; cin >> l.Modeli;
cout << "Ishlab chiqarilgan yili: "; cin >> l.Ishlab_chiqarilgan_yili;
cout << "Markasi: "; cin >> k.Markasi;
cout << "Rangi: "; cin >> k.Rangi;
cout << "Modeli: "; cin >> k.Modeli;
cout << "Ishlab chiqarilgan yili: "; cin >> k.Ishlab_chiqarilgan_yili;
cout << "Markasi: "; cin >> j.Markasi;
cout << "Rangi: "; cin >> j.Rangi;
cout << "Modeli: "; cin >> j.Modeli;
cout << "Ishlab chiqarilgan yili: "; cin >> j.Ishlab_chiqarilgan_yili;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
3. Kollej (Kollej joylashgan xudud, kollej direktori, o’quvchilar soni)- --o’quvchilar soni
####################################################################
#include
using namespace std;
class Kollej {
public:
char Kollej_Manzil[30];
char Kollej_Direktor[30];
int Uquvchilar_soni;
friend void set(Kollej k);
};
void set(Kollej k) {
cout << k.Uquvchilar_soni << endl;
}
int main() {
Kollej l, k, j;
cout << "Kollej manzil: "; cin >> l.Kollej_Manzil;
cout << "Kollej direktori: "; cin >> l.Kollej_Direktor;
cout << "O'quvchilar soni: "; cin >> l.Uquvchilar_soni;
cout << "Kollej manzil: "; cin >> k.Kollej_Manzil;
cout << "Kollej direktori: "; cin >> k.Kollej_Direktor;
cout << "O'quvchilar soni: "; cin >> k.Uquvchilar_soni;
cout << "Kollej manzil: "; cin >> j.Kollej_Manzil;
cout << "Kollej direktori: "; cin >> j.Kollej_Direktor;
cout << "O'quvchilar soni: "; cin >> j.Uquvchilar_soni;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
4. Professor-o‘qituvchi (OTM, kafedrasi, mutaxassisligi, ish staji)--OTM
####################################################################
#include
using namespace std;
class Professor_uqituvchi{
public:
char OTM[30];
char kafedrasi[30];
char mutaxassisligi[40];
int ish_staji;
friend void set(Professor_uqituvchi k);
};
void set(Professor_uqituvchi k) {
cout << k.OTM << endl;
}
int main() {
Professor_uqituvchi l, k, j;
cout << "OTM: "; cin >> l.OTM;
cout << "Kafedra: "; cin >> l.kafedrasi;
cout << "Mutaxassisligi: "; cin >> l.mutaxassisligi;
cout << "Ish staji: "; cin >> l.ish_staji;
cout << "OTM: "; cin >> k.OTM;
cout << "Kafedra: "; cin >> k.kafedrasi;
cout << "Mutaxassisligi: "; cin >> k.mutaxassisligi;
cout << "Ish staji: "; cin >> k.ish_staji;
cout << "OTM: "; cin >> j.OTM;
cout << "Kafedra: "; cin >> j.kafedrasi;
cout << "Mutaxassisligi: "; cin >> j.mutaxassisligi;
cout << "Ish staji: "; cin >> j.ish_staji;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
5. Muzey (Joylashgan xududi, rahbari, muzeyning , turi)-- Muzeyning turi
####################################################################
#include
using namespace std;
class Muzey {
public:
char Joylashgan_hudud[30];
char Rahbari[30];
char Muzey_turi[40];
friend void set(Muzey k);
};
void set(Muzey k) {
cout << k.Muzey_turi << endl;
}
int main() {
Muzey l, k, j;
cout << "Joylashgan hududi: "; cin >> l.Joylashgan_hudud;
cout << "Rahbari: "; cin >> l.Rahbari;
cout << "Muzey turi: "; cin >> l.Muzey_turi;
cout << "Joylashgan hududi: "; cin >> k.Joylashgan_hudud;
cout << "Rahbari: "; cin >> k.Rahbari;
cout << "Muzey turi: "; cin >> k.Muzey_turi;
cout << "Joylashgan hududi: "; cin >> j.Joylashgan_hudud;
cout << "Rahbari: "; cin >> j.Rahbari;
cout << "Muzey turi: "; cin >> j.Muzey_turi;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
6. Mehmonxona (Maqomi, Joylashgan xududi, rahbari)--Maqomi
####################################################################
#include
using namespace std;
class Mehmonxona {
public:
char Joylashgan_hudud[30];
char Maqomi[30];
char Rahbari[40];
friend void set(Mehmonxona k);
};
void set(Mehmonxona k) {
cout << k.Maqomi << endl;
}
int main() {
Mehmonxona l, k, j;
cout << "Maqomi: "; cin >> l.Maqomi;
cout << "Joylashgan hudud: "; cin >> l.Joylashgan_hudud;
cout << "Rahbari: "; cin >> l.Rahbari;
cout << "Maqomi: "; cin >> k.Maqomi;
cout << "Joylashgan hudud: "; cin >> k.Joylashgan_hudud;
cout << "Rahbari: "; cin >> k.Rahbari;
cout << "Maqomi: "; cin >> j.Maqomi;
cout << "Joylashgan hudud: "; cin >> j.Joylashgan_hudud;
cout << "Rahbari: "; cin >> j.Rahbari;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
7. Kutubxona (Joylashgan xududi, kitoblar soni, rahbari, kutubxonaning turi)-- Joylashgan xududi
####################################################################
#include
using namespace std;
class Kutubxona {
public:
char Joylashgan_hudud[30];
int Kitoblar_soni;
char Rahbari[40];
char Kutubxona_Turi[40];
friend void set(Kutubxona k);
};
void set(Kutubxona k) {
cout << k.Joylashgan_hudud << endl;
}
int main() {
Kutubxona l, k, j;
cout << "Kutubxona Turi: "; cin >> l.Kutubxona_Turi;
cout << "Joylashgan hudud: "; cin >> l.Joylashgan_hudud;
cout << "Rahbari: "; cin >> l.Rahbari;
cout << "Kitoblar soni: "; cin >> l.Kitoblar_soni;
cout << "Kutubxona Turi: "; cin >> k.Kutubxona_Turi;
cout << "Joylashgan hudud: "; cin >> k.Joylashgan_hudud;
cout << "Rahbari: "; cin >> k.Rahbari;
cout << "Kitoblar soni: "; cin >> k.Kitoblar_soni;
cout << "Kutubxona Turi: "; cin >> j.Kutubxona_Turi;
cout << "Joylashgan hudud: "; cin >> j.Joylashgan_hudud;
cout << "Rahbari: "; cin >> j.Rahbari;
cout << "Kitoblar soni: "; cin >> j.Kitoblar_soni;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
8. Telefon (Markasi, modeli, tezkor xotiraning hajmi, ishlab chiqarilgan yili)-- Markasi
####################################################################
#include
using namespace std;
class Telefon {
public:
char Markasi[30];
int Ishlab_chiqarilgan_yili;
char Modeli[40];
int Ram;
friend void set(Telefon k);
};
void set(Telefon k) {
cout << k.Markasi << endl;
}
int main() {
Telefon l, k, j;
cout << "Markasi: "; cin >> l.Markasi;
cout << "Modeli: "; cin >> l.Modeli;
cout << "Tezkor hotirasi: "; cin >> l.Ram;
cout << "Ishlab chiqarilgan yili: "; cin >> l.Ishlab_chiqarilgan_yili;
cout << "Markasi: "; cin >> k.Markasi;
cout << "Modeli: "; cin >> k.Modeli;
cout << "Tezkor hotirasi: "; cin >> k.Ram;
cout << "Ishlab chiqarilgan yili: "; cin >> k.Ishlab_chiqarilgan_yili;
cout << "Markasi: "; cin >> j.Markasi;
cout << "Modeli: "; cin >> j.Modeli;
cout << "Tezkor hotirasi: "; cin >> j.Ram;
cout << "Ishlab chiqarilgan yili: "; cin >> j.Ishlab_chiqarilgan_yili;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
9. Ishchi (ism, tseh nomeri, razryad, staj) --Staj
####################################################################
#include
using namespace std;
class Ishchi {
public:
char Ismi[30];
int Tel_raqami;
int Razryad;
int Staj;
friend void set(Ishchi k);
};
void set(Ishchi k) {
cout << k.Staj << endl;
}
int main() {
Ishchi l, k, j;
cout << "Ismi: "; cin >> l.Ismi;
cout << "Telefon raqami: "; cin >> l.Tel_raqami;
cout << "Razryad: "; cin >> l.Razryad;
cout << "Staj: "; cin >> l.Staj;
cout << "Ismi: "; cin >> k.Ismi;
cout << "Telefon raqami: "; cin >> k.Tel_raqami;
cout << "Razryad: "; cin >> k.Razryad;
cout << "Staj: "; cin >> k.Staj;
cout << "Ismi: "; cin >> j.Ismi;
cout << "Telefon raqami: "; cin >> j.Tel_raqami;
cout << "Razryad: "; cin >> j.Razryad;
cout << "Staj: "; cin >> j.Staj;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
10. Shaxs (ism, yosh, jins, millat) --Milat
####################################################################
#include
using namespace std;
class Shaxs {
public:
char Ism[30];
int Yosh;
char Jins[30];
char Millat[30];
friend void set(Shaxs k);
};
void set(Shaxs k) {
cout << k.Millat << endl;
}
int main() {
Shaxs l, k, j;
cout << "Ism: "; cin >> l.Ism;
cout << "Yosh: "; cin >> l.Yosh;
cout << "Jins: "; cin >> l.Jins;
cout << "Millat: "; cin >> l.Millat;
cout << "Ism: "; cin >> k.Ism;
cout << "Yosh: "; cin >> k.Yosh;
cout << "Jins: "; cin >> k.Jins;
cout << "Millat: "; cin >> k.Millat;
cout << "Ism: "; cin >> j.Ism;
cout << "Yosh: "; cin >> j.Yosh;
cout << "Jins: "; cin >> j.Jins;
cout << "Millat: "; cin >> j.Millat;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
11. Xodim (ism, lavozim, sana, oylik) --Lavozim
####################################################################
#include
using namespace std;
class Xodim {
public:
char Ism[30];
int Sana;
char Lavozim[30];
int Oylik;
friend void set(Xodim k);
};
void set(Xodim k) {
cout << k.Lavozim << endl;
}
int main() {
Xodim l, k, j;
cout << "Ism: "; cin >> l.Ism;
cout << "Lavozim: "; cin >> l.Lavozim;
cout << "Sana: "; cin >> l.Sana;
cout << "Oylik: "; cin >> l.Oylik;
cout << "Ism: "; cin >> k.Ism;
cout << "Lavozim: "; cin >> k.Lavozim;
cout << "Sana: "; cin >> k.Sana;
cout << "Oylik: "; cin >> k.Oylik;
cout << "Ism: "; cin >> j.Ism;
cout << "Lavozim: "; cin >> j.Lavozim;
cout << "Sana: "; cin >> j.Sana;
cout << "Oylik: "; cin >> j.Oylik;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
12. Shifokor( ism, familiyasi, pochtasi,toifasi)--Familiyasi
####################################################################
#include
using namespace std;
class Shifokor {
public:
char Ism[30];
char Familyasi[30];
char Pochtasi[30];
char Toifasi[30];
friend void set(Shifokor k);
};
void set(Shifokor k) {
cout << k.Familyasi << endl;
}
int main() {
Shifokor l, k, j;
cout << "Ism: "; cin >> l.Ism;
cout << "Familyasi: "; cin >> l.Familyasi;
cout << "Pochtasi: "; cin >> l.Pochtasi;
cout << "Toifasi: "; cin >> l.Toifasi;
cout << "Ism: "; cin >> k.Ism;
cout << "Familyasi: "; cin >> k.Familyasi;
cout << "Pochtasi: "; cin >> k.Pochtasi;
cout << "Toifasi: "; cin >> k.Toifasi;
cout << "Ism: "; cin >> j.Ism;
cout << "Familyasi: "; cin >> j.Familyasi;
cout << "Pochtasi: "; cin >> j.Pochtasi;
cout << "Toifasi: "; cin >> j.Toifasi;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
13. Xizmatchi (ism, yosh, bo’lim, staj)—Bo’lim
####################################################################
#include
using namespace std;
class Xizmatchi {
public:
char Ism[30];
int Yosh;
char Bulim[30];
char Staj[30];
friend void set(Xizmatchi k);
};
void set(Xizmatchi k) {
cout << k.Bulim << endl;
}
int main() {
Xizmatchi l, k, j;
cout << "Ism: "; cin >> l.Ism;
cout << "Yosh: "; cin >> l.Yosh;
cout << "Bo'lim: "; cin >> l.Bulim;
cout << "Staj: "; cin >> l.Staj;
cout << "Ism: "; cin >> k.Ism;
cout << "Yosh: "; cin >> k.Yosh;
cout << "Bo'lim: "; cin >> k.Bulim;
cout << "Staj: "; cin >> k.Staj;
cout << "Ism: "; cin >> j.Ism;
cout << "Yosh: "; cin >> j.Yosh;
cout << "Bo'lim: "; cin >> j.Bulim;
cout << "Staj: "; cin >> j.Staj;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################
14. Xokkeychi (ism, yosh, amplua, komanda)--ampula
####################################################################
#include
using namespace std;
class Xokkeychi {
public:
char Ism[30];
int Yosh;
char Amplua[30];
char Komanda[30];
friend void set(Xokkeychi k);
};
void set(Xokkeychi k) {
cout << k.Amplua << endl;
}
int main() {
Xokkeychi l, k, j;
cout << "Ism: "; cin >> l.Ism;
cout << "Yosh: "; cin >> l.Yosh;
cout << "Amplua: "; cin >> l.Amplua;
cout << "Komanda: "; cin >> l.Komanda;
cout << "Ism: "; cin >> k.Ism;
cout << "Yosh: "; cin >> k.Yosh;
cout << "Amplua: "; cin >> k.Amplua;
cout << "Komanda: "; cin >> k.Komanda;
cout << "Ism: "; cin >> j.Ism;
cout << "Yosh: "; cin >> j.Yosh;
cout << "Amplua: "; cin >> j.Amplua;
cout << "Komanda: "; cin >> j.Komanda;
set(k); set(l); set(j);
_getwch();
return 0;
}
####################################################################