Advertisement
Guest User

foobar

a guest
May 3rd, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. //17
  2. int amount, price, total;
  3. bool done;
  4. while (!done)
  5. {
  6. total = 0;
  7. cout << "Enter amount of products" << endl;
  8. cin >> amount;
  9. cout << endl;
  10. for (int i = 0; i < amount; i++)
  11. {
  12. cout << "Enter the price of product " << i + 1 << endl;
  13. cin >> price;
  14. cout << endl;
  15. total += price;
  16. }
  17. if (total < 200)
  18. total = total + 10(amount);
  19. cout << "you must pay " << total << "$" << endl;
  20. cout << "enter 1 if done, 0 otherwise" << endl;
  21. cin >> done;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement