Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //decalre array
- int chg[4]= {15,10,5,0};
- int max[4] ={12,50,100,99999};
- int order = 0;
- while(order != -1)
- {
- cout <<"Enter Number of items ordered (-1 TO QUIT): " << endl;
- cin >> order;
- if(order == -1)
- { system("pause");
- return 0;
- }
- int value;
- for (int n = 0; n<4; n++)
- {
- if (order > max[n] && order < max[n+1])
- {
- value = chg[n];
- cout << "Shipping: " << value << endl;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment