Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.74 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int cod,summin;
  7.     float min,cashsum;
  8.     char repeat;
  9.     const int SIZE = 3;
  10.     int minmassiv[SIZE];
  11.     float cashmassiv[SIZE];
  12.     setlocale(LC_ALL, "ru");
  13.     system("cls");
  14.  
  15.     cout << "\n\n\t ------------------------------" << endl;
  16.     cout << "\t|Программа для подсчета минут| " << endl;
  17.     cout << "\t ------------------------------\n\n" << endl;
  18.  
  19.     system("pause");
  20.     system("cls");
  21.    
  22.     do
  23.     {
  24.         cout << " \n\n\t -------------------------------------------------" << endl;
  25.         cout << "\t | Mobile  operators | Code| Price per minute, UAH| " << endl;
  26.         cout << "\t | Kyivstar          |  67 |           3.00       | " << endl;
  27.         cout << "\t | MTS               |  66 |           2.50       | " << endl;
  28.         cout << "\t | LIFE              |  63 |           2.00       | " << endl;
  29.         cout << "\t -------------------------------------------------" << endl;
  30.  
  31.         for (int i = 0; i < SIZE; i++)
  32.     {
  33.         cout << "\n ВВедите количество минут - ";
  34.         cin >> minmassiv[i];
  35.         cout << "\n ВВедите код оператора - ";
  36.         cin >> cod;
  37.  
  38.         switch (cod)
  39.         {
  40.         case 67:
  41.             cout << " Вы ввели Код Оператора Киевстар " << endl;
  42.             cashmassiv[i] = 3 * minmassiv[i];
  43.             cout << " Затраченная сумма на разговор -" << cashmassiv[i] << " гривень." << endl;
  44.             break;
  45.         case 66:
  46.             cashmassiv[i] = 2.5 * minmassiv[i];
  47.             cout << " Вы ввели Код Оператора MTS " << endl;
  48.             cout << " Затраченная сумма на разговор -" << cashmassiv[i] << " гривень." << endl;
  49.             break;
  50.         case 63:
  51.             cashmassiv[i] = 2 * minmassiv[i];
  52.             cout << " Вы ввели Код Оператора LIFE " << endl;
  53.             cout << " Затраченная сумма на разговор -" << cashmassiv[i] << " гривень." << endl;
  54.             break;
  55.         default:
  56.             cout << " Введен неверный код " << endl;
  57.         }
  58.     }  
  59.  
  60.         summin = 0;
  61.         for (int i = 0; i < SIZE; i++)
  62.         {
  63.             summin += minmassiv[i];
  64.         }
  65.         cashsum = 0;
  66.         for (int i = 0; i < SIZE; i++)
  67.         {
  68.             cashsum += cashmassiv[i];
  69.         }
  70.        
  71.        
  72.         cout << "\n Всего минут - " << summin << endl;
  73.         cout << "\n Общая сумма - " << cashsum << endl;
  74.        
  75.        
  76.         do
  77.         {
  78.             cout << " Повторить попытку ? " << endl;
  79.             cin >> repeat;
  80.             cout<<"! Неверный символ !" << endl;
  81.  
  82.         } while (repeat != 'Y' && repeat != 'y' && repeat != 'N' && repeat != 'n');
  83.  
  84.         system("cls");
  85.  
  86.    
  87.     } while (repeat != 'N' && repeat != 'n');
  88.     cout << "\n\n\t\tДО ВСТРЕЧИ !!!!" << endl;
  89.         cout << "\n\t\tЖДЕМ ВАС СНОВА";
  90.         for (int i = 0; i < 15; i++)
  91.         {
  92.             cout << "\n";
  93.         }
  94.    
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement