Public: string name = "kastum"; string firma



Download 348,59 Kb.
Sana16.07.2022
Hajmi348,59 Kb.
#810428
Bog'liq
Kastum va SHim


#include "stdafx.h"
#include
#include
#include
using namespace std;
class kastum
{
public:
string name = "kastum";
string firma;
string material;
float razmer_eni;
float razmer_buyi;
int narx;

void show1()


{
cout << name << " " << firma << " " << material << " " << razmer_eni << "x" << razmer_buyi << " " << narx << endl;
}
friend void qidirish1(kastum z[100], int n, string nom);
friend void saralash1(kastum z[100], int n);
};
class shim
{
public:
string name = "shim";
string firmasi;
string materiali;
float razmeri_eni;
float razmeri_buyi;
int narxi;
void show2()
{
cout << name << " " << firmasi << " " << materiali << " " << razmeri_eni << "x" << razmeri_buyi << " " << narxi << endl;
}
friend void saralash2(shim z[100], int n);
friend void qidirish2(shim z[100], int n, string nom);
};

void qidirish1(kastum z[100], int n, string nom)


{
bool bor = false;
cout << "\nMahsulot nomi | firmasi | materiali | razmeri(sm) | narxi(sum) \n";
for (int i = 0; i < n; i++)
{
if (z[i].firma == nom)
{
bor = true;
z[i].show1();
}
if (!bor)
{
cout << "Bu firma kastumlari ro'yhatda yo'q\n\n";
}
}
}
void qidirish2(shim z[100], int n, string nom)
{
bool bor = false;
for (int i = 0; i < n; i++)
{
if (z[i].firmasi == nom)
{
bor = true;
z[i].show2();
}
if (!bor)
{
cout << "\nBu firma shimlari ro'yhatda yo'q\n";
}
}
}

void saralash1(kastum z[100], int n)


{
cout << "mahsulot nomi va firma nomi bo'yicha saralash: \n";

for (int i = 0; i < n; i++)


{
for (int j = 0; j < n; j++)
{
if (z[i].firma.compare(z[j].firma) < 0)
{
kastum temp = z[i];
z[i] = z[j];
z[j] = temp;
}
}
}
for (int i = 0; i < n; i++)
{
z[i].show1();
}
}
void saralash2(shim z[100], int n)
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (z[i].firmasi.compare(z[j].firmasi) < 0)
{
shim temp = z[i];
z[i] = z[j];
z[j] = temp;
}
}
}
for (int i = 0; i < n; i++)
{
z[i].show2();
}
}

int main()


{
cout << "mahsulotlar sonini kirirtng: ";
int n;
cin >> n;
kastum a[n];
shim b[n];
for (int i = 0; i < n; i++)
{
cout << i + 1 << "-kastum firmasi nomini kiriting: ";
cin >> a[i].firma;
cout << i + 1 << "-kastum materiali nomini kiriting: ";
cin >> a[i].material;
cout << i + 1 << "-kastum razmerini kiriting(sm): (120 257) ";
cin >> a[i].razmer_eni;
cin >> a[i].razmer_buyi;
cout << i + 1 << "-kastum narxini kiriting: ";
cin >> a[i].narx;
}
cout << "\n_______________________________________________\n";
for (int i = 0; i < n; i++)
{
cout << i + 1 << "-shim firmasi nomini kiriting: ";
cin >> b[i].firmasi;
cout << i + 1 << "-shim materiali nomini kiriting: ";
cin >> b[i].materiali;
cout << i + 1 << "-shim razmerini kiriting(sm): (40 120) ";
cin >> b[i].razmeri_eni;
cin >> b[i].razmeri_buyi;
cout << i + 1 << "-shim narxini kiriting: ";
cin >> b[i].narxi;
}
cout << "\n____________________________________________________________\n";
cout << "\nMahsulot nomi | firmasi | materiali | razmeri(sm) | narxi(sum) \n";
for (int i = 0; i < n; i++)
{
a[i].show1();
b[i].show2();
}
cout << "\n____________________________________________________________\n";
cout << "qidirilayotgan mahsulotning firmasi nomini kiriting: ";
string nom;
cin >> nom;
qidirish1(a, n, nom);
qidirish2(b, n, nom);

cout << "\n____________________________________________________________\n";


saralash1(a, n);
saralash2(b, n);
system("pause");
return 0;
}#include "stdafx.h"
#include
#include
#include
using namespace std;
class kastum
{
public:
string name = "kastum";
string firma;
string material;
float razmer_eni;
float razmer_buyi;
int narx;

void show1()


{
cout << name << " " << firma << " " << material << " " << razmer_eni << "x" << razmer_buyi << " " << narx << endl;
}
friend void qidirish1(kastum z[100], int n, string nom);
friend void saralash1(kastum z[100], int n);
};
class shim
{
public:
string name = "shim";
string firmasi;
string materiali;
float razmeri_eni;
float razmeri_buyi;
int narxi;
void show2()
{
cout << name << " " << firmasi << " " << materiali << " " << razmeri_eni << "x" << razmeri_buyi << " " << narxi << endl;
}
friend void saralash2(shim z[100], int n);
friend void qidirish2(shim z[100], int n, string nom);
};

void qidirish1(kastum z[100], int n, string nom)


{
bool bor = false;
cout << "\nMahsulot nomi | firmasi | materiali | razmeri(sm) | narxi(sum) \n";
for (int i = 0; i < n; i++)
{
if (z[i].firma == nom)
{
bor = true;
z[i].show1();
}
if (!bor)
{
cout << "Bu firma kastumlari ro'yhatda yo'q\n\n";
}
}
}
void qidirish2(shim z[100], int n, string nom)
{
bool bor = false;
for (int i = 0; i < n; i++)
{
if (z[i].firmasi == nom)
{
bor = true;
z[i].show2();
}
if (!bor)
{
cout << "\nBu firma shimlari ro'yhatda yo'q\n";
}
}
}

void saralash1(kastum z[100], int n)


{
cout << "mahsulot nomi va firma nomi bo'yicha saralash: \n";

for (int i = 0; i < n; i++)


{
for (int j = 0; j < n; j++)
{
if (z[i].firma.compare(z[j].firma) < 0)
{
kastum temp = z[i];
z[i] = z[j];
z[j] = temp;
}
}
}
for (int i = 0; i < n; i++)
{
z[i].show1();
}
}
void saralash2(shim z[100], int n)
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (z[i].firmasi.compare(z[j].firmasi) < 0)
{
shim temp = z[i];
z[i] = z[j];
z[j] = temp;
}
}
}
for (int i = 0; i < n; i++)
{
z[i].show2();
}
}

int main()


{
cout << "mahsulotlar sonini kirirtng: ";
int n;
cin >> n;
kastum a[n];
shim b[n];
for (int i = 0; i < n; i++)
{
cout << i + 1 << "-kastum firmasi nomini kiriting: ";
cin >> a[i].firma;
cout << i + 1 << "-kastum materiali nomini kiriting: ";
cin >> a[i].material;
cout << i + 1 << "-kastum razmerini kiriting(sm): (120 257) ";
cin >> a[i].razmer_eni;
cin >> a[i].razmer_buyi;
cout << i + 1 << "-kastum narxini kiriting: ";
cin >> a[i].narx;
}
cout << "\n_______________________________________________\n";
for (int i = 0; i < n; i++)
{
cout << i + 1 << "-shim firmasi nomini kiriting: ";
cin >> b[i].firmasi;
cout << i + 1 << "-shim materiali nomini kiriting: ";
cin >> b[i].materiali;
cout << i + 1 << "-shim razmerini kiriting(sm): (40 120) ";
cin >> b[i].razmeri_eni;
cin >> b[i].razmeri_buyi;
cout << i + 1 << "-shim narxini kiriting: ";
cin >> b[i].narxi;
}
cout << "\n____________________________________________________________\n";
cout << "\nMahsulot nomi | firmasi | materiali | razmeri(sm) | narxi(sum) \n";
for (int i = 0; i < n; i++)
{
a[i].show1();
b[i].show2();
}
cout << "\n____________________________________________________________\n";
cout << "qidirilayotgan mahsulotning firmasi nomini kiriting: ";
string nom;
cin >> nom;
qidirish1(a, n, nom);
qidirish2(b, n, nom);

cout << "\n____________________________________________________________\n";


saralash1(a, n);
saralash2(b, n);
system("pause");
return 0;
}

Download 348,59 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