Muhammad al Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti Fargʻona filiali komputer injiniringi fakulteti at-servis yoʻnalishi 81-22-guruh talabasi Maxsudov Dilyorbekning Dasturlash fanidan kichik loyiha ishi
Download 188.4 Kb.
|
Loyiha ishi
- Bu sahifa navigatsiya:
- Natija
Muhammad al Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti Fargʻona filiali komputer injiniringi fakulteti AT-servis yoʻnalishi 681-22-guruh talabasi Maxsudov Dilyorbekning Dasturlash 1 fanidan kichik loyiha ishi #include using namespace std; class Phone_sales{ public: string d_name; string model; string cpu; int ram; int rom; int cost; string c_name; long phone; int money; Phone_sales set(string d_name, string model, string cpu, int ram, int rom, int cost) { Phone_sales telefon; telefon.attach(d_name, model, cpu, ram, rom, cost); return telefon; } void attach(string d_name, string model, string cpu, int ram, int rom, int cost) { this->d_name = d_name; this->model = model; this->cpu = cpu; this->ram = ram; this->rom = rom; this->cost = cost; } void input() { cout << "<---- Bizga ma'lumotlaringizni qoldiring ---->" << endl << endl; cout << "Ismingiz: ";cin >> c_name; cout << "Tel. raqamingiz: ";cin >> phone; cout << "Smartphone olish uchun ajratgan mablag'ingiz ($): "; cin >> money; cout << "\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nIltimos kuting\nSiznig hamyoningizga tog'ri keladigan smartponelarni saralayapmiz" << endl; } void createFile(string name){ cout << "Mijozning Ismi: " << c_name << endl; cout << "Mijozning tel. raqami: " << phone << endl; cout << "Mijoz kiritgan summa: " << money << endl; cout << "Mijozga to'g'ri keladigan smartphonelar ro'yxati: " << endl; } void print_device(string name) { cout << "\nSmartphone nomi: " << d_name << "\nModeli: " << model << "\nProtsessor: " << cpu << "\nTezkor xotira xajmi: " << ram << "\nTelefon xotira hajmi :" << "\nKompyuter narxi: " << cost; cout << "\n\n******\n"; } }; int main() { Phone_sales obj; obj.input(); Phone_sales device; Phone_sales Telefonlar[12] = { device.set("Samsung", "S10 5G", "Exynos 9820", 8, 256, 250), device.set("Samsung", "A73", "Snapdragon 778G 5G", 6, 128, 430), device.set("Samsung", "J9", "Snapdragon 450", 3, 32, 310), device.set("Samsung", "S22 ultra", "Exynos 2200", 12, 512, 710), device.set("Xiaomi", "Mi 11", "Snapdragon 888 5G", 8, 256, 700), device.set("Xiaomi", "Xiaomi Redmi Note 8 Pro", "Helio G90T", 6, 128, 220), device.set("Xiaomi", "12S ultra", "Snapdragon 8+ Gen 1", 12, 512, 950), device.set("Xiaomi", "Mi Mix Alpha", "Snapdragon 855+", 12, 512, 2500), device.set("Apple", "iPhone 7", "Apple A10 Fusion", 2, 128, 180), device.set("Apple", "iPhone 11 Pro", "Apple A13 Bionic", 4, 256, 400), device.set("Apple", "iPhone Xs Max", "Apple A12 Bionic", 4, 256, 570), device.set("Apple", "iPhone 14 Pro Max", "Apple A16 Bionic", 6, 512, 1100), }; int summ = 0; for (int i=0; i<11; i++){ if((Telefonlar[i].cost <= obj.money + 100 && Telefonlar[i].cost >= obj.money - 100)){ Telefonlar[i].print_device(obj.c_name); } } return 0; } Natija : Download 188.4 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling