Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6. int main() {
  7. double pay = 0, sum = 0, average = 0;
  8. double max;
  9. double min;
  10. int i = 1;
  11. max = pay;
  12. min = pay;
  13.  
  14. cout << "Please enter a list of your spending: " << endl;
  15.  
  16. while (pay != -9999) {
  17.  
  18. if (pay > max) {
  19. max = pay;
  20. }
  21.  
  22. if (pay < min || pay != 0 || pay != -9999) {
  23. min = pay;
  24. }
  25.  
  26. cout << "Transaction #" << i++ << ": ";
  27. cin >> pay;
  28.  
  29.  
  30. }
  31.  
  32. average = sum / pay;
  33. cout << "Minimum Number: " << "$" << min << endl;
  34. cout << "Maximum Number: " << "$" << max << endl;
  35.  
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement