-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAccount.cpp
More file actions
41 lines (29 loc) · 1015 Bytes
/
Account.cpp
File metadata and controls
41 lines (29 loc) · 1015 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//Name: Atticus Crook
//Purpose: Implementation of the functions and constructors of the Account class
//Date Modified: 12/02/24
//Compiler Used: MS VC++ 2022
#include "Account.h"
#include <stdexcept>
using namespace std;
//Account class' methods, getters, setters and constructors
//*********************************************************
Account::Account() : account_number(0), balance(0) {} // default constructor
//constructor for account_number and balance
Account::Account(long account_number, double balance) {
this->account_number = account_number;
this->balance = balance;
}
//getters for Account class (not virtual functions, those are defined in subclasses)
double Account::getBalance() const {
return this->balance;
}
long Account::getAccountNumber() const {
return this->account_number;
}
//setters for Account class
void Account::setBalance(double balance) {
this->balance = balance;
}
void Account::setAccountNumber(long account_number) {
this->account_number = account_number;
}