Toshkent Axborot Texnoligiyalar Universiteti 315-20 guruh talabas
Download 16.16 Kb.
|
Toshkent Axborot Texnoligiyalar Universiteti 315
Toshkent Axborot Texnoligiyalar Universiteti 315-20 guruh talabas ASADOV MIRONSHOHning 9-labaratoriya ishi 13. Rombsinfiyaratilsinvakonstruktore’lonqilinsin. Undakamidauchtamaydonvaularniekrangachiqaruvchivaqaytaishlovchisinfmetodlariniyarating. #include #include usingnamespace std; classRomb {
int d1,d2; constfloat pi = 3.14;
cout<<"Rombdiagonallarinikiriting: "< }
Romb(int i,int j) { }
Romb(int i, int j,int h) { a = sqrt(pow(i / 2, 2) + pow(j / 2, 2)); cout<<"Rombperimetri: "<< 4*a < cout<<"Rombyuzasi: "<
}
};
cout<<"d1="; cin>> k.d1; cout<<"d2="; cin>> k.d2; Romb(k.d1, k.d2); Romb(k.d1, k.d2, k.d1); return 0; } 13. Firmaningxodimlarto’g’risidaquyidagima’lumotlarma’lum: Familiyasi, ismi, oilaviyaxvoli (turmushqurganyokiyo’q ), farzandi (boryokiyo’q) haqidama’lumotberilgan. Farzandibo’lganxodimlarro’yxatinichopetuvchidasturtuzing. #include usingnamespace std; classGuruh_haqida { public:
friendvoidprint(Guruh_haqidah); charfamiliyasi[30]; charismi[30]; boolfarzandi; }; voidprint(Guruh_haqidah) { if (h.uzunligi> 160) { cout< }
}
cout<<"familiyasi: "; cin>>k.familiyasi; cout<<”ismi: "; cin>>k.ismi; cout<<"farzandi: "; cin>>k. farzandi; cout<<"familiyasi: "; cin>>l.familiyasi; cout<<"ismi: "; cin>>l.ismi; cout<<"farzandi: "; cin>>l. farzandi;
print(l); _getwch(); return 0; } 13. Xizmatchi (ism, yosh, bo’lim, staj)—Bo’lim #################################################################### #include usingnamespace std; classXizmatchi { public:
charIsm[30]; intYosh; charBulim[30]; charStaj[30]; friendvoidset(Xizmatchik); }; voidset(Xizmatchik) { cout< } intmain() { 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; } Download 16.16 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling