Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- double moneyTotal = 0;
- double withdraw = 0;
- double choice = 0;
- double choiceTwo = 0;
- cout << "Please enter the total amount of money in this account: ";
- cin >> moneyTotal;
- if (moneyTotal <= 0)
- {
- cout << "Insufficient funds, you may not make a transaction." << endl;
- }
- else if (moneyTotal > 0)
- {
- cout << "Please enter the amount you wish to withdraw: ";
- cin >> withdraw;
- if (withdraw > moneyTotal && !(withdraw == 501))
- {
- cout << "You have requested to withdraw more than is available in this" << endl;
- cout << "account. There is a $25.00 service fee for this withdrawal." << endl;
- cout << "Press 1 to agree, or press 2 to cancel." << endl;
- cin >> choice;
- if (choice == 1)
- {
- moneyTotal = moneyTotal - withdraw - 25;
- cout << "Amount dispensed is $" << withdraw << endl;
- cout << "Your account balance is now $" << moneyTotal << endl;
- }
- else if (choice == 2)
- {
- cout << "The transaction has been canceled" << endl;
- }
- }
- if (withdraw >= 501)
- {
- cout << "The maximum amount you may withdraw at one time is $500, this" << endl;
- cout << "transaction cannot be processed." << endl;
- }
- if (withdraw > 300 && withdraw < 501 && !(withdraw > moneyTotal))
- {
- cout << "There is a service charge of 4% for withdrawals over $300, press" << endl;
- cout << "1 to agree, press to 2 cancel: ";
- cin >> choice;
- if (choice == 1)
- {
- double serviceFee = (withdraw - 300) * .04;
- moneyTotal = moneyTotal - withdraw - serviceFee;
- cout << "Amount dispensed is: $" << withdraw << endl;
- cout << "Your account balance is now $" << moneyTotal << endl;
- }
- else if (choice == 2)
- {
- cout << "This transaction has been canceled." << endl;
- }
- }
- }
- if (!(withdraw > 300 || withdraw >= 501 || withdraw <= 0))
- {
- moneyTotal = moneyTotal - withdraw;
- cout << "Your account balance is now $" << moneyTotal << ", thank you and have a great day." << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement