Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int cod,summin;
- float min,cashsum;
- char repeat;
- const int SIZE = 3;
- int minmassiv[SIZE];
- float cashmassiv[SIZE];
- setlocale(LC_ALL, "ru");
- system("cls");
- cout << "\n\n\t ------------------------------" << endl;
- cout << "\t|Программа для подсчета минут| " << endl;
- cout << "\t ------------------------------\n\n" << endl;
- system("pause");
- system("cls");
- do
- {
- cout << " \n\n\t -------------------------------------------------" << endl;
- cout << "\t | Mobile operators | Code| Price per minute, UAH| " << endl;
- cout << "\t | Kyivstar | 67 | 3.00 | " << endl;
- cout << "\t | MTS | 66 | 2.50 | " << endl;
- cout << "\t | LIFE | 63 | 2.00 | " << endl;
- cout << "\t -------------------------------------------------" << endl;
- for (int i = 0; i < SIZE; i++)
- {
- cout << "\n ВВедите количество минут - ";
- cin >> minmassiv[i];
- cout << "\n ВВедите код оператора - ";
- cin >> cod;
- switch (cod)
- {
- case 67:
- cout << " Вы ввели Код Оператора Киевстар " << endl;
- cashmassiv[i] = 3 * minmassiv[i];
- cout << " Затраченная сумма на разговор -" << cashmassiv[i] << " гривень." << endl;
- break;
- case 66:
- cashmassiv[i] = 2.5 * minmassiv[i];
- cout << " Вы ввели Код Оператора MTS " << endl;
- cout << " Затраченная сумма на разговор -" << cashmassiv[i] << " гривень." << endl;
- break;
- case 63:
- cashmassiv[i] = 2 * minmassiv[i];
- cout << " Вы ввели Код Оператора LIFE " << endl;
- cout << " Затраченная сумма на разговор -" << cashmassiv[i] << " гривень." << endl;
- break;
- default:
- cout << " Введен неверный код " << endl;
- }
- }
- summin = 0;
- for (int i = 0; i < SIZE; i++)
- {
- summin += minmassiv[i];
- }
- cashsum = 0;
- for (int i = 0; i < SIZE; i++)
- {
- cashsum += cashmassiv[i];
- }
- cout << "\n Всего минут - " << summin << endl;
- cout << "\n Общая сумма - " << cashsum << endl;
- do
- {
- cout << " Повторить попытку ? " << endl;
- cin >> repeat;
- cout<<"! Неверный символ !" << endl;
- } while (repeat != 'Y' && repeat != 'y' && repeat != 'N' && repeat != 'n');
- system("cls");
- } while (repeat != 'N' && repeat != 'n');
- cout << "\n\n\t\tДО ВСТРЕЧИ !!!!" << endl;
- cout << "\n\t\tЖДЕМ ВАС СНОВА";
- for (int i = 0; i < 15; i++)
- {
- cout << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement