evgeni_tsn

Untitled

Dec 1st, 2015
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1. // Example program
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace::std;
  6.  
  7. int main()
  8. {
  9.   int option;
  10.   cout << "Select option:" << endl;
  11.   cout << "--1--Enter real numbers F(K) (K <= 25)"<< endl;
  12.   cout << "--2--Calculate average of array numbers"<< endl;
  13.   cout << "--3--Calculate sum of zeroes and non-zeroes"<< endl;
  14.   cin >> option;
  15.   while(true){
  16.   switch(option){
  17.     case 1:
  18.         int n;
  19.         double currNum;
  20.         double arr[n];
  21.         cout << "---- Enter size of the array: ";
  22.         cin >> n;
  23.         cout << "---- Fill the array: " << endl;
  24.          for(int i = 0; i < n; i++)
  25.         {
  26.         double currNum;
  27.         cin>>currNum;
  28.         while(currNum>25)
  29.         {
  30.             cout<<"The number must be > 25" << endl;
  31.             cin>>currNum;
  32.         }
  33.         arr[i] = currNum;
  34.         }
  35.         break;
  36.         case 2:
  37.         double min, max;
  38.         cout<< "Enter min"<<endl;
  39.         cin >> min;
  40.         cout<< "Enter max"<<endl;
  41.         cin >> max;
  42.         for(int i = 0; i < n; i++)
  43.         {
  44.            
  45.         }
  46.         break;
  47.   }
  48.   }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment