Advertisement
Guest User

Untitled

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