-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAccount.h
More file actions
53 lines (43 loc) · 1.18 KB
/
BankAccount.h
File metadata and controls
53 lines (43 loc) · 1.18 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef BANKACCOUNT
#define BANKACOOUNT
class BankAccount { // 2021136089 À̰ü¿ì
protected:
int balance{0};
int accountNumber;
static float interestRate;
public:
BankAccount();
void getBalance() noexcept;
virtual void deposit(int amount) noexcept;
virtual void withdraw(int amount) noexcept;
void getAccountNumber() noexcept;
void setAccountNumber(int num) noexcept;
virtual void addInterest();
static void setInterestRate(float rate) noexcept;
};
float BankAccount::interestRate;
class SavingsAccount : public BankAccount {
private:
static float interestRate;
public:
SavingsAccount();
void addInterest();
static void setInterestRate(float rate) noexcept;
};
float SavingsAccount::interestRate;
class MinusAccount : public BankAccount {
private:
float loanRate;
int loanLimit;
static float interestRate;
public:
MinusAccount();
void setLimit(int limit);
void setLoanRate(float loanRate);
static void setInterestRate(float rate) noexcept;
void addInterest() override;
void withdraw(int amount) noexcept override;
void deposit(int amount) noexcept override;
};
float MinusAccount::interestRate;
#endif