9-labaratoriya yechimlari!!!



Download 89,79 Kb.
Sana21.07.2021
Hajmi89,79 Kb.
#125410
Bog'liq
9-labaratoriya


9-labaratoriya yechimlari!!!

1-jadval:

1. To’g’ri to’rt burchak sinfi yaratilsin. Kamida shu sinfda ikkita sinf konstruktori yaratilsin. Birinchi sinf konstruktori yaratilgan sinf haqida ma’lumot berilsin. Ikkinchi sinf konstruktori tugri turtburchak yuzi va perimetrini ekranga chiqarib berilsin.

####################################################################

#include

#include

using namespace std;

class Turt_burchak {

int a, b, c;

public:
Turt_burchak() {

cout << "To'g'ri to'rtburchakning tomonlari: " << endl;

}

Turt_burchak(int k, float l) {



cout << "Perimetri: " << k << endl;

cout << "Yuzasi: " << l << endl;

}

};

int main() {



int a, b, p;

float s;

Turt_burchak();

cout << "a="; cin >> a;

cout << "b="; cin >> b;


p = 2*(a + b);

s = a*b;

Turt_burchak(p, s);

return 0;

}

####################################################################



2. Shar sinfi yaratilsin va konstruktor e’lon qilinsin. Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class shar {

int r;

public:


shar() {

cout << "Sharning radiusi: " << endl;

}

shar(float s,float v) {


cout << "S=" << s << endl;

cout << "V=" << v << endl;

}

};

int main() {



int r;

float s, v;

const float pi = 3.14;

shar();
cout << "R="; cin >> r;

s = 4 * pi*pow(r, 2);

v = (4 / 3) * pi*pow(r, 3);

shar(s, v);

return 0;

}

####################################################################



3. Uchburchak sinfi yaratilsin va konstruktor e’lon qilinsin. Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Uchburchak {

int a,b,c;

public:


Uchburchak() {

cout << "Uchburchakning tomonlari: " << endl;

}

Uchburchak(int k,float l) {



cout << "Perimetri: " << k << endl;

cout << "Yuzasi: " << l << endl;

}

};

int main() {



int a, b, c,p;

float s;

Uchburchak ();

cout << "a="; cin >> a;

cout << "b="; cin >> b;

cout << "c="; cin >> c;

p = a + b + c;

s = sqrt((p / 2)*(p / 2 - a)*(p / 2 - b)*(p / 2 - c));

Uchburchak(p,s);

return 0;

}

####################################################################



4. Geometric_shakl sinfi yaratilsin va konstruktor e’lon qilinsin . Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Geometric_shakl {

public:

char turi[30];

char ulchamlari[40];

friend void print(Geometric_shakl k);

Geometric_shakl() {

cout << "Geometrik shakl turini kiriting: ";

}

};

void print(Geometric_shakl k) {



cout << "Kiritilgan shakl haqida ma'lumot:" << endl;

cout << "Geometrik shakl turi: "<

cout << "Geometrik o'lchamlari: " << k.ulchamlari << endl;

}

int main() {


Geometric_shakl l;

cin >> l.turi;

cout << "Geometrik shakl o'lchamlari: ";

cin >> l.ulchamlari;

print(l);

return 0;

}

####################################################################



5. Prizma sinfi yaratilsin. Shu sinfga tegishli kamida 3 ta sinf konstruktori yaratilsin. Birinchi sing konstruktorida prizma haqida ma’lumot berilsin. Ikkinchi prizmada hajmi topilsin. Uchunchi konstruktorda hajmi va yon sirti topilsin. Sinf konstruktorlari qayta yuklansin.

####################################################################

#include

#include

using namespace std;

class Prizma {

public:

int n, a, h;

Prizma(int i,int j,int g) {

cout << "Prizmaning o'lchamlarini kirriting: " << endl;

n = g;

a = i;


h = j;

}

Prizma(float p) {



cout << "Hajmi: " << p << endl;

}

Prizma(float k, float l) {



cout << "Hajmi: " <

cout << "To'la yuzi: " << l << endl;

}

};

int main() {



int a, h, n;

float s, v;

cout << "Prizmaning o'lchamlarini kiriting: " << endl;

cout << "a="; cin >> a;

cout << "h="; cin >> h;

cout << "n="; cin >> n;

s = ((n * 2 * pow(a, 2)) / (4 * tan(180 / n))) + a*h*n;

v = (n*h*pow(a, 2)) / (4 * tan(180 / n));

Prizma(a, h, n);

Prizma(v,s);

return 0;

}

####################################################################



6. Kub sinfi yaratilsin. Bunda kamida 2 ta sinf konstruktori yaratilsin. Birinchi sinf konstruktorida kub haqida ma’lumot berilsin. Ikkinchi sinf konstruktorida kub hajmi bilan yon sirti topilsin. Konstruktorlar qayta yuklansin.

####################################################################

#include

#include

using namespace std;

class Kub {

public:


Kub() {

cout << "Kubning tomonini kiriting: " << endl;

}

Kub(int p) {



cout << "To'la yuzi: " << 6 * pow(p, 2) << endl;

cout << "Hajmi: " << pow(p, 3) << endl;

}

};

int main() {



int a;

Kub();


cout << "a="; cin >> a;

Kub ol(a);

return 0;

}

####################################################################



7. Parallelipiped sinfi yaratilsin va konstruktor e’lon qilinsin . Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Kub {

public:

int a;


int b;

int c;
Kub() {

cout << "Paralelopepid tomonilarini kiriting: " << endl;

}

void print() {



cout << "Paralelopepid eni: " << a<

cout << "Paralelopepid bo'yi: " << b<

cout << "Paralelopepid balandligi: " << c<

cout << "Paralelopepid hajmi: " << a*b*c;

}

};

int main() {



Kub k;

cout << "a="; cin >> k.a;

cout << "b="; cin >> k.b;

cout << "c="; cin >> k.c;

k.print();

return 0;

}

####################################################################



8. Maydon sinfi yaratilsin. Shu maydonga tegishli 3 ta sinf konstruktori yaratilsin. Bu sinf konstruktori uchta geometric shaklni maydonini topib ekranga chiqarilsin.

####################################################################

#include

using namespace std;

class Maydon {

public:


Maydon(int a, int b, int s) {

cout << "1 - geometrik shakl maydoni: Kvadrat s= " << a*a << endl;

}

Maydon() {



cout << "2- geometrik shakl maydoni nuqta, yuzaga ega emas!" << endl;

}

Maydon(int a, int b) {



cout << "3- shakl geometrik shakl maydoni: To'g'ri to'rtburchak s= " << a*b << endl;

}

};



int main()

{

int g, h;



cin >> g >> h;
Maydon(g, g, g);

Maydon();

Maydon(g, h);

return 0;

}

####################################################################



9. Silindir sinfi yaratilsin va konstruktor e’lon qilinsin . Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Silindr {


public:

int h;


int r;

const float pi = 3.14;


Silindr() {

cout << "Silindr o'lchamlarini kiriting: " << endl;

}

void print() {



cout << "Silindr radiusi: " << r << endl;

cout << "Silindr balandligi: " << h << endl;

cout << "Silindr yuzasi: " << 2 * pi*r*(h + r)<

cout << "Silindr hajmi: " << pi*pow(r,2)*h;

}

};

int main() {


Silindr k;

cout << "r="; cin >> k.r;

cout << "h="; cin >> k.h;

k.print();


return 0;

}

####################################################################



10. Nuqta nomli sinf yaratilsin. Kamida ikkita sinf konstruktori yaratilsin. Birinchi sinf kontruktori ikki nuqta orasidagi masafani topilsin. Ikkinchi konstruktorida uchburchak yuzi topilsin.

####################################################################

#include

#include

using namespace std;

class Nuqta {


public:

int x1,y1;

int x2,y2;

Nuqta() {

cout << "Nuqtalarni kiriting: " << endl;

}

void print() {



float m;

cout << "Birinchi nuqta: (" << x1 << "," << y1 << ")" << endl;

cout << "Ikkinchi nuqta: (" << x2 << "," << y2 << ")" << endl;

m = sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2));

cout << "Ikki nuqta orasidagi masofa: " << m;

}

};



int main() {
Nuqta k;

cout << "x1="; cin >> k.x1;

cout << "y1="; cin >> k.y1;

cout << "x2="; cin >> k.x2;

cout << "y2="; cin >> k.y2;

k.print();


return 0;

}

####################################################################



11. Konus sinfi yaratilsin va konstruktor e’lon qilinsin . Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Konus {


public:

int h;


int r;

const float pi = 3.14;


Konus() {

cout << "Konus o'lchamlarini kiriting: " << endl;

}

Konus(int i,int j) {



cout << "Konus radiusi: " << i << endl;

cout << "Konus balandligi: " << j << endl;

}

Konus(int i,int j,int g,int h) {



cout << "Konus hajmi: " << (pi*pow(i, 2)*j) / 3<

}

Konus(int i, int j, int h) {



cout << "Konus yuzasi: " << pi*i*(j + sqrt(pow(i, 2) + pow(j, 2))) << endl;

}

};



int main() {
Konus k;

cout << "r="; cin >> k.r;

cout << "h="; cin >> k.h;

Konus(k.r, k.h);

Konus(k.r,k.h,k.r,k.h);

Konus(k.r, k.h,k.h);

return 0;

}

####################################################################



12. Shar sinfi yaratilsin. Bu sinfda kamida 3 ta sinf konstruktori yaratilsin. Birinchi sinf konstruktorida shar haqida ma’lumot berilsin. Ikkinchi sinf konstruktorida sharni yon sirti yuzi hisoblansin. Uchunchi sinf konstruktorida sharni Hajmi hisoblansin.

####################################################################

#include

#include

using namespace std;

class Shar {


public:

int r;


const float pi = 3.14;
Shar() {

cout << "Shar o'lchamlarini kiriting: " << endl;

}

Shar(int i) {



cout << "Shar radiusi: " << i << endl;

}

Shar(int i, int j) {



cout << "Shar hajmi: " << (4 / 3) * pi*pow(i, 3) << endl;

}

Shar(int i, int j, int h) {



cout << "Shar yuzasi: " << 4 * pi*pow(i, 2) << endl;

}

};



int main() {
Shar k;

cout << "r="; cin >> k.r;

Shar(k.r);

Shar(k.r, k.r);

Shar(k.r, k.r, k.r);

return 0;

}

####################################################################



13. Romb sinfi yaratilsin va konstruktor e’lon qilinsin. Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Romb {


public:

int d1,d2;

const float pi = 3.14;
Romb() {

cout << "Romb diagonallarini kiriting: " << endl;

}

Romb(int i,int j) {



cout << "Romb tomoni: " << sqrt(pow(i/2,2)+pow(j/2,2)) << endl;

}

Romb(int i, int j,int h) {



float a;

a = sqrt(pow(i / 2, 2) + pow(j / 2, 2));

cout << "Romb perimetri: " << 4*a << endl;

cout << "Romb yuzasi: " << i*j/2 << endl;

}

};

int main() {


Romb k;

cout << "d1="; cin >> k.d1;

cout << "d2="; cin >> k.d2;

Romb(k.d1, k.d2);

Romb(k.d1, k.d2, k.d1);

return 0;

}

####################################################################



14. Trapetsiya sinfi yaratilsin va konstruktor e’lon qilinsin. Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Trapetsiya {


public:

int a,b,h;


Trapetsiya() {

cout << "Trapetsiya asoslari va balandligini kiriting: " << endl;

}

Trapetsiya(int i,int j,int h) {



cout << "Trapetsiya balandligi: " << h << endl;

cout << "Trapetsiya katta asosi: " << j<< endl;

cout << "Trapetsiya kichik asosi: " << i << endl;

}

Trapetsiya(int i, int j,int h,int g) {



cout << "Trapetsiya yuzasi: " << ((i+j)/2)*h << endl;

}

};



int main() {
Trapetsiya k;

cout << "a="; cin >> k.a;

cout << "b="; cin >> k.b;

cout << "h="; cin >> k.h;

Trapetsiya(k.h, k.b, k.a);

Trapetsiya(k.a,k.b,k.h,k.b);


return 0;

}

####################################################################



15. Silindr sinfi yaratilsin. Bu sinfda kamida 3 ta sinf konstruktori yaratilsin. Birinchi sinf konstruktorida tsilindr haqida ma’lumot berilsin. Ikkinchi sinf konstruktorida konusni yon sirti yuzi hisoblansin. Uchunchi sinf konstruktorida tsilindrni Hajmi hisoblansin.

####################################################################

#include

#include

using namespace std;

class Silindr {


public:

int h;


int r;

const float pi = 3.14;


Silindr() {

cout << "Silindr o'lchamlarini kiriting: " << endl;

}

Silindr(int i, int j) {



cout << "Silindr radiusi: " << i << endl;

cout << "Silindr balandligi: " << j << endl;

}

Silindr(int i, int j,int h) {



cout << "Silindr yuzasi: " << 2 * pi*i*(j + i) << endl;

cout << "Silindr hajmi: " << pi*pow(i, 2)*j;

}

};

int main() {


Silindr k;

cout << "r="; cin >> k.r;

cout << "h="; cin >> k.h;

Silindr(k.r, k.h);

Silindr(k.r, k.h,k.h);

return 0;

}

####################################################################



16. Piramida sinfi yaratilsin va konstruktor e’lon qilinsin. Unda kamida uchta maydon va ularni ekranga chiqaruvchi va qayta ishlovchi sinf metodlarini yarating.

####################################################################

#include

#include

using namespace std;

class Piramida {


public:

int h;


int a;

int n;



Piramida() {

cout << "Piramida o'lchamlarini kiriting: " << endl;

}

Piramida(int i, int j,int g) {



cout << "Piramida a=: " << i << endl;

cout << "Piramida h=: " << j << endl;

cout << "Piramida n=: " << g << endl;

}

};



int main() {
Piramida k;

cout << "r="; cin >> k.a;

cout << "h="; cin >> k.h;

cout << "h="; cin >> k.n;

Piramida(k.a, k.h,k.n);

return 0;

}

####################################################################



2-jadval:

1. Haridorlar haqida quyidagi tartibda ma’lumotlar keltirilgan: Tartib raqami, familiyasi, ismi, haridorning uy manzili. Ro’yxatdan takrorlangan familiyasi, ismga ega haridorlarni o’chirib tashlang.

####################################################################

#include


using namespace std;
class Haridorlar_haqida {

public:


friend void print(Haridorlar_haqida h);

unsigned int tartib_raqami;

char familyasi[20];

char ismi[20];

char haridorning_uy_manzili[30];

};

void print(Haridorlar_haqida h) {



cout << "Tartib raqami: " << h.tartib_raqami<

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;



}

####################################################################

Download 89,79 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish