daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Sep 25th, 2018 78 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.   double moneyTotal = 0;
  6.   double withdraw = 0;
  7.   double choice = 0;
  8.   double choiceTwo = 0;
  9.  
  10.   cout << "Please enter the total amount of money in this account: ";
  11.   cin >> moneyTotal;
  12.  
  13.   if (moneyTotal <= 0)
  14.     {
  15.       cout << "Insufficient funds, you may not make a transaction." << endl;
  16.     }
  17.  
  18.   else if (moneyTotal > 0)
  19.     {
  20.       cout << "Please enter the amount you wish to withdraw: ";
  21.       cin >> withdraw;
  22.  
  23.       if (withdraw > moneyTotal && !(withdraw == 501))
  24.         {
  25.           cout << "You have requested to withdraw more than is available in this" << endl;
  26.           cout << "account. There is a $25.00 service fee for this withdrawal." << endl;
  27.           cout << "Press 1 to agree, or press 2 to cancel." << endl;
  28.           cin >> choice;
  29.  
  30.           if (choice == 1)
  31.             {
  32.               moneyTotal = moneyTotal - withdraw - 25;
  33.               cout << "Amount dispensed is $" << withdraw << endl;
  34.               cout << "Your account balance is now $" << moneyTotal << endl;
  35.             }
  36.  
  37.           else if (choice == 2)
  38.             {
  39.               cout << "The transaction has been canceled" << endl;
  40.             }
  41.  
  42.         }
  43.  
  44.       if (withdraw >= 501)
  45.         {
  46.           cout << "The maximum amount you may withdraw at one time is $500, this" << endl;
  47.           cout << "transaction cannot be processed." << endl;
  48.         }
  49.  
  50.       if (withdraw > 300 && withdraw < 501 && !(withdraw > moneyTotal))
  51.         {
  52.           cout << "There is a service charge of 4% for withdrawals over $300, press" << endl;
  53.           cout << "1 to agree, press to 2 cancel: ";
  54.           cin >> choice;
  55.  
  56.         if (choice == 1)
  57.           {
  58.             double serviceFee = (withdraw - 300) * .04;
  59.             moneyTotal = moneyTotal - withdraw - serviceFee;
  60.             cout << "Amount dispensed is: $" << withdraw << endl;
  61.             cout << "Your account balance is now $" << moneyTotal << endl;
  62.           }
  63.  
  64.           else if (choice == 2)
  65.           {
  66.             cout << "This transaction has been canceled." << endl;
  67.           }
  68.         }
  69.     }
  70.  
  71.     if (!(withdraw > 300 || withdraw >= 501 || withdraw <= 0))
  72.       {
  73.         moneyTotal = moneyTotal - withdraw;
  74.         cout << "Your account balance is now $" << moneyTotal << ", thank you and have a great day." << endl;
  75.       }
  76.  
  77.   return 0;
  78. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top