Guest User

Untitled

a guest
Apr 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. //decalre array
  7. int chg[4]= {15,10,5,0};
  8. int max[4] ={12,50,100,99999};
  9. int order = 0;
  10.  
  11. while(order != -1)
  12. {
  13. cout <<"Enter Number of items ordered (-1 TO QUIT): " << endl;
  14. cin >> order;
  15.  
  16. if(order == -1)
  17. { system("pause");
  18. return 0;
  19. }
  20.  
  21. int value;
  22. for (int n = 0; n<4; n++)
  23.  
  24. {
  25. if (order > max[n] && order < max[n+1])
  26. {
  27. value = chg[n];
  28. cout << "Shipping: " << value << endl;
  29. }
  30.  
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment