-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBusinessAccount.cpp
More file actions
27 lines (21 loc) · 838 Bytes
/
BusinessAccount.cpp
File metadata and controls
27 lines (21 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "BusinessAccount.h"
#include <iostream>
BusinessAccount::BusinessAccount(const std::string& accNum, Customer* cust, double initialBalance, double limit, double fee)
: Account(accNum, cust, initialBalance), transactionLimit(limit), businessFees(fee) {}
void BusinessAccount::deposit(double amount) {
balance += amount;
}
bool BusinessAccount::withdraw(double amount) {
if (amount + businessFees > balance || amount > transactionLimit) return false;
balance -= (amount + businessFees);
return true;
}
void BusinessAccount::applyInterest() {
// Business accounts may not accrue interest.
}
void BusinessAccount::generateBusinessReport() {
std::cout << "Generating business report for " << accountNumber << std::endl;
}
std::string BusinessAccount::getAccountType() const {
return "Business";
}