Advertisement
NewbProgrammer

This?

Dec 17th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. std::vector<Division> CreateCorporateFile()
  2. {
  3.     std::vector<Division> divArray;
  4.     Division div;
  5.      int x = 0;
  6. for(int x = 0; x < 4; x++)
  7.  do {
  8.           int quarter = 1;
  9.           cout << "Enter the name of the division: ";
  10.           cin >> div.divName;
  11.           for(int i = 0; i < 4; i++)
  12.           {
  13.                cout << "Enter in the sales for quarter "<< quarter <<": ";
  14.                cin >> div.sales[i];
  15.                if(div.sales[i] > 0)
  16.                {
  17.                     quarter++;
  18.                }
  19.                else
  20.                {
  21.                     cout << "Sales are not allowed to be negative.\n";
  22.                }
  23.           }
  24.           divArray.push_back(div);
  25.           x++;
  26.      } while(x < 4);
  27.      
  28.      return divArray;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement