Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. /*
  2. */
  3. #include<iostream>
  4. #include<cmath>
  5. #include<iomanip>
  6. #include<string>
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12. //Declare variables
  13. int chex = 0;
  14. double bal, total;
  15. double month = 10;
  16.  
  17. // Get info
  18. cout << "Checking Account Fees\n\n";
  19. cout << "Please Enter Account Balance\n";
  20. cin >> bal;
  21. cout << "Please Enter Amount of Checks Used\n";
  22. cin >> chex;
  23.  
  24.  
  25. cout << setprecision(2) << fixed;
  26. // Program first checks if balance is negative amount
  27. if (bal <= -1)
  28. {cout << "Insufficient Funds" << endl;}
  29.  
  30. // Program checks if input for checks is valid
  31.  
  32. if (chex <= -1)
  33. {cout << "Invalid Input" << endl;}
  34.  
  35. //Program determines if amount in account is under 400
  36.  
  37. else if ((chex < 19) && (chex > 0) && (bal < 400))
  38. {total = month +15 +(chex * .10);
  39. cout << "Total Fees \n$" << total << endl;}
  40.  
  41. else if ((chex > 20) && (chex < 39))
  42. {total = month +15+ (chex*.08);
  43. cout << "Total Fees\n$" << total << endl;}
  44. else if ((chex > 40) && (chex < 59))
  45. {total = month +15+ (chex*.06);
  46. cout << "Total Fees\n$" << total << endl;}
  47. else if (chex >= 60)
  48. {total = month +15+ (chex*.08);
  49. cout << "Total Fees\n$" << total << endl;}
  50.  
  51.  
  52. // Program for accounts over 400
  53.  
  54. if ((chex < 19) && (chex > 0) && (bal >=400))
  55. {total = month +(chex * .10);
  56. cout << "Total Fees\n$" << total << endl;}
  57.  
  58. else if ((chex > 20) && (chex < 39))
  59. {total = month + (chex*.08);
  60. cout << "Total Fees\n$" << total << endl;}
  61. else if ((chex > 40) && (chex < 59))
  62. {total = month + (chex*.06);
  63. cout << "Total Fees\n$" << total << endl;}
  64. else if (chex >= 60)
  65. {total = month + (chex*.08);
  66. cout << "Total Fees for the Month\n$" << total << endl;}
  67.  
  68.  
  69. return 0;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement