bet 7/7 Sana 14.06.2022 Hajmi 92,45 Kb. #667612
Bog'liq
programmalash asoslari Mustaqil ishi Abdinazarov Kamoliddin Struktura (2)
#include
#include
using namespace std ;
struct guvohnoma{
public:
string g_familya;
string g_ism;
string g_sharif;
int g_yil;
int g_oy;
int g_kun;
};
struct mahalla_spravka{
public:
string tugilgan_joy;
string tugilgan_joy1;
string millati;
string kim_tomonidan_berilgan;
string kim_tomonidan_berilgan1;
};
struct Met_daftar : public guvohnoma , public mahalla_spravka { // class larni boglash :public nom
public:
string jinsi;
void PASSPORT() {
cout << "\t " << "\t OZBEKISTON RESPUBLIKASI" << endl;
cout << "\n FAMILYASI " << endl;
cout << "\t " << g_familya << endl;
cout << "\n ISMI: " ; cout << "\t " << "\t " << "\t " << "\t " << "\t " << "\t " << "\t JINSI " << endl;
cout << "\t " << g_ism ; cout << "\t " << "\t " << "\t " << "\t " << "\t " << " " << jinsi << endl;
cout << "\n OTASINING ISMI" << endl;
cout << "\t " << g_sharif << endl;
cout << "\n TUGILGAN SANASI " ; cout << "\t " << "\t TUGILGAN JOYI" << endl;
cout << "\t " << g_kun << " " << g_oy << " " << g_yil ; cout << "\t " << "\t" << "\t" << tugilgan_joy ;
cout << "\n" << " MILLATI " << endl;
cout << "\t " << millati << endl;
cout << "\n KIM TOMONIDAN BERILGAN" << endl;
cout << "\t " << kim_tomonidan_berilgan << endl;
cout << "\t " << kim_tomonidan_berilgan1 << endl;
cout << endl << endl;
cout << "\t " << "\t " << "\t " << "\t " << "\t " <<"\t SHAXSIY IMZO/HOLDER'S SIGNATURE" << endl;
cout << "____" << endl << endl;
cout << "\t " << "\t OZBEKISTON RESPUBLIKASI /REPUBLIC OF UZBEKISTAN " << endl;
cout << "\n " << "PASPORT PASSPORT "; cout << " TURI / TYPE";
cout << " DAVLAT KODI / COUNTRY CODE";
cout << " PASPORT RAQAMI / PASSPORT No" << endl;
cout << "\t " << "\t " << "\t P"; cout << "\t " << "\t " << "\t UZB"; cout << "\t " << "\t " << "\t " << " AC 2760072 " << endl ;
cout << "\t " << "\t FAMILYASI/SURNAME " << endl;
cout << "\t " << "\t " << "\t " << g_familya << endl;
cout << "\t " << "\t ISMI/GIVEN NAMES " << endl;
cout << "\t " << "\t " << "\t " << g_ism << endl;
cout << "\t " << "\t FUQAROLIGI/NATIONALITY " << endl;
cout << "\t " << "\t " << "\t " << g_ism << endl;
cout << "\t " << "\t TUGILGAN SANASI/DATE OF BIRTH" << endl;
cout << "\t " << "\t " << "\t " << " " << g_kun << " " << g_oy << " " << g_yil << endl;
cout << "\t " << "\t JINSI/*** " ; cout << "\t TUGILGAN JOYI/PLACE OF BIRTH " << endl;
cout << "\t " << "\t " << " M " ; cout << "\t " << "\t " << "\t " << tugilgan_joy1 << endl;
cout << "\t " << "\t BERILGAN SANASI/DATE OF ISSUE " ; cout << "\t PERSONALLASHTIRISH ORGANI/AUTHORITY" << endl;
cout << "\t " << "\t " << "\t " << " 02 03 2020" << "\t "; cout << "\t STATE PERSONALIZATION " << endl;
cout << "\t " << "\t AMAL QILISH MUDDATI/DATE OF EXPIRY" ; cout << "\t " << "CENTRE " << endl;
cout << "\t " << "\t " << "\t " << " 01 03 2030" << endl;
cout << "\n P
cout << "\n AC2760072UZB0311269M30030135261103605002500 " << endl;
}
};
int main() {
Met_daftar dela1;
dela1.g_familya = "ABDINAZAROV";
dela1.g_ism = "KAMOLIDDIN";
dela1.g_sharif = "GOIBNAZAR OGLI";
dela1.g_yil = 2003;
dela1.g_oy = 11;
dela1.g_kun = 26;
dela1.millati = "O`ZBEK";
dela1.tugilgan_joy = "ISHTIXON TUMANI";
dela1.kim_tomonidan_berilgan = "SAMARQAND VILOYATI";
dela1.kim_tomonidan_berilgan1 = "ISHTIXON TUMANI IIB";
dela1.tugilgan_joy1 = "SAMARKAND REGION";
dela1.jinsi = "ERKAK";
dela1.PASSPORT();
cout << endl;
return 0;
}
Natijani tekshirish – testlash
1-test:
5. XULOSA
Dasturda 3 ta strukturadan foydalandik va har bir strukturaga 1 ta hujjat joylashtirdik.5-qatorga guvohnoma nomli skruktura yaratdik. 16-satrda mahalla_spravka nomli struktura yaratdik .26-qatorda Met_daftar nomli struktura yaratdik va struct Met_daftar : public guvohnoma , public mahalla_spravka mana shu ko`rinishda 3 ta strukturani bir strukturaga bog`ladik. Bu yerda public nomli ommaviy tip kiritdik. Buning vazi-fasi strukturada e`lon qilingan qiymatlarni dasturning ixtiyoriy yerida qo`llay
olishdir. Dasturning int main() qismida structurada berilgan qiymatlar kiri-tildi va PASSPORT() nomli funksiyaga joylashtirdik. Bundan tashqari das-turda bir nechta metodlardan foydalandik. Qisqacha qilib aytganda qo’yilgan masalani yechish uchun strukturadan foydalanildi. Bunda bir nechta strukturalar tuzildi va ularga hujjatlar yozib chiqildi. Ular bir-biriga bog`landi va Pasport huj-jati tayyorlandi. Shunday qilib vazifa bajarildi va Pasportning tayyor shabloni ek-ranga chiqarildi.
Do'stlaringiz bilan baham: