Advertisement
NewbProgrammer

Loop

Dec 17th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1.      for(int i = 0; i < 4; i++)
  2.      {
  3.              int quarter = 1;
  4.              cout << "Enter the name of the division: ";
  5.              cin >> div.divName[i];
  6.              for(int i = 0; i < 4; i++)
  7.              {
  8.                   cout << "Enter in the sales for quarter "<< quarter <<": ";
  9.                   cin >> div.sales[i];
  10.                   if(div.sales[i] > 0)
  11.                   {
  12.                        quarter++;
  13.                   }
  14.                   else
  15.                   {
  16.                        cout << "Sales are not allowed to be negative.\n";
  17.                   }
  18.              }
  19.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement