Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- */
- #include<iostream>
- #include<cmath>
- #include<iomanip>
- #include<string>
- using namespace std;
- int main()
- {
- //Declare variables
- int chex = 0;
- double bal, total;
- double month = 10;
- // Get info
- cout << "Checking Account Fees\n\n";
- cout << "Please Enter Account Balance\n";
- cin >> bal;
- cout << "Please Enter Amount of Checks Used\n";
- cin >> chex;
- cout << setprecision(2) << fixed;
- // Program first checks if balance is negative amount
- if (bal <= -1)
- {cout << "Insufficient Funds" << endl;}
- // Program checks if input for checks is valid
- if (chex <= -1)
- {cout << "Invalid Input" << endl;}
- //Program determines if amount in account is under 400
- else if ((chex < 19) && (chex > 0) && (bal < 400))
- {total = month +15 +(chex * .10);
- cout << "Total Fees \n$" << total << endl;}
- else if ((chex > 20) && (chex < 39))
- {total = month +15+ (chex*.08);
- cout << "Total Fees\n$" << total << endl;}
- else if ((chex > 40) && (chex < 59))
- {total = month +15+ (chex*.06);
- cout << "Total Fees\n$" << total << endl;}
- else if (chex >= 60)
- {total = month +15+ (chex*.08);
- cout << "Total Fees\n$" << total << endl;}
- // Program for accounts over 400
- if ((chex < 19) && (chex > 0) && (bal >=400))
- {total = month +(chex * .10);
- cout << "Total Fees\n$" << total << endl;}
- else if ((chex > 20) && (chex < 39))
- {total = month + (chex*.08);
- cout << "Total Fees\n$" << total << endl;}
- else if ((chex > 40) && (chex < 59))
- {total = month + (chex*.06);
- cout << "Total Fees\n$" << total << endl;}
- else if (chex >= 60)
- {total = month + (chex*.08);
- cout << "Total Fees for the Month\n$" << total << endl;}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement