CurrentAccount.cpp
上传用户:sz0451
上传日期:2022-07-29
资源大小:256k
文件大小:1k
- #include "stdafx.h"
- #include "CurrentAccount.h"
- CurrentAccount::CurrentAccount(String * holder, double limit)
- :BankAccount(holder), overdraftLimit(limit)
- {
- }
- CurrentAccount::~CurrentAccount()
- {
- }
- void CurrentAccount::ChangeOverdraftLimit(double newLimit)
- {
- overdraftLimit = newLimit;
- }
- String * CurrentAccount::ToString()
- {
- String * result = __super::ToString();
- result = result->Concat(result, S", Overdraft Limit: ");
- result = result->Concat(result, overdraftLimit.ToString());
- return result;
- }
- bool CurrentAccount::CanDebit(double amount)
- {
- if (amount <= balance + overdraftLimit)
- {
- return true;
- }
- else
- {
- return false;
- }
- }