Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #ifndef CHECKING_H
- #define CHECKING_H
- #include "BankAccount.h"
- using namespace std;
- class Checking : public BankAccount
- {
- public:
- Checking()
- { }
- virtual void withdraw(double amount)
- {
- double tempGetServiceCharge;
- //double tempBalance = getBalance();
- if ((getBalance() - amount) <= 0)
- {
- tempGetServiceCharge = getServiceCharge() + 15.0;
- setServiceCharge(tempGetServiceCharge);
- //setBalance(tempBalance - 15);
- cout << "Insufficient funds. A $15 service charge has been"
- << " deducted from your account.\n";
- }
- else
- {
- BankAccount::withdraw(amount);
- tempGetServiceCharge = getServiceCharge() + 0.10;
- setServiceCharge(tempGetServiceCharge);
- //setBalance(tempBalance - 0.10);
- }
- }
- virtual void monthlyProc()
- {
- double tempGetServiceCharge;
- tempGetServiceCharge = 5 + getServiceCharge();
- setServiceCharge(tempGetServiceCharge);
- //double tempBalance = getBalance();
- //tempBalance -= .1;
- //setBalance(tempBalance);
- BankAccount::monthlyProc();
- }
- //Destructor
- ~Checking() {};
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement