-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExternalAccount.cpp
More file actions
74 lines (57 loc) · 1.61 KB
/
Copy pathExternalAccount.cpp
File metadata and controls
74 lines (57 loc) · 1.61 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* ExternalAccount.cpp
*
* Created on: Feb 1, 2014
* Author: nzayatz14
*/
#include "ExternalAccount.h"
namespace std {
ExternalAccount::ExternalAccount() {
password = "password";
createInternalAccounts();
accountNumber = 0;
}
void ExternalAccount::createInternalAccounts(){
internalAccounts[0].setAccountType("Checking");
internalAccounts[0].setMoney(0);
internalAccounts[1].setMoney(0);
internalAccounts[1].setAccountType("Savings");
}
void ExternalAccount::displayExternalAccount(){
cout<<accountHolder.getUserName()<<"\t"<<password<<"\t"<<accountNumber<<endl;
}
string ExternalAccount::getPassword(){
return password;
}
void ExternalAccount::getAccountHolder(Client *c){
accountHolder.copyClient(*c);
}
void ExternalAccount::getInternalAccounts(InternalAccount &d, InternalAccount &e){
internalAccounts[0].copyInternalAccount(d);
internalAccounts[1].copyInternalAccount(e);
}
void ExternalAccount::setPassword(string s){
password = s;
}
void ExternalAccount::setAccountNumber(int g){
accountNumber = g;
}
void ExternalAccount::setInternalAccounts(InternalAccount &a, InternalAccount &b){
a.copyInternalAccount(internalAccounts[0]);
b.copyInternalAccount(internalAccounts[1]);
}
void ExternalAccount::setAccountHolder(Client &c){
c.copyClient(accountHolder);
}
void ExternalAccount::copyExternalAccount(ExternalAccount &e){
e.setAccountNumber(accountNumber);
e.setAccountHolder(accountHolder);
e.setInternalAccounts(internalAccounts[0], internalAccounts[1]);
e.setPassword(password);
}
int ExternalAccount::getAccountNumber(){
return accountNumber;
}
ExternalAccount::~ExternalAccount() {
}
}