Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. #include <iostream>
  2. #ifndef CHECKING_H
  3. #define CHECKING_H
  4. #include "BankAccount.h"
  5. using namespace std;
  6.  
  7. class Checking : public BankAccount
  8. {
  9. public:
  10.     Checking()
  11.     {   }
  12.  
  13.  
  14.     virtual void withdraw(double amount)
  15.     {
  16.         double tempGetServiceCharge;
  17.         //double tempBalance = getBalance();
  18.  
  19.         if ((getBalance() - amount) <= 0)
  20.         {
  21.             tempGetServiceCharge = getServiceCharge() + 15.0;
  22.             setServiceCharge(tempGetServiceCharge);
  23.             //setBalance(tempBalance - 15);
  24.             cout << "Insufficient funds. A $15 service charge has been"
  25.                 << " deducted from your account.\n";
  26.         }
  27.         else
  28.         {
  29.         BankAccount::withdraw(amount);
  30.         tempGetServiceCharge = getServiceCharge() + 0.10;
  31.         setServiceCharge(tempGetServiceCharge);
  32.         //setBalance(tempBalance - 0.10);
  33.         }
  34.     }
  35.  
  36. virtual void monthlyProc()
  37.     {
  38.         double tempGetServiceCharge;
  39.         tempGetServiceCharge = 5 + getServiceCharge();
  40.         setServiceCharge(tempGetServiceCharge);
  41.         //double tempBalance = getBalance();
  42.         //tempBalance -= .1;
  43.         //setBalance(tempBalance);
  44.         BankAccount::monthlyProc();
  45.     }
  46.  
  47. //Destructor
  48.     ~Checking() {};
  49.  
  50.  
  51. };
  52.  
  53. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement