-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomer.h
executable file
·59 lines (50 loc) · 2.03 KB
/
Customer.h
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
#pragma once
#include <string>
#include "Checking.h"
#include "Savings.h"
using namespace std;
class Customer
{
private:
int ID;
int PIN;
string Name;
string Address;
string Phone;
int ZipCode;
string City;
string State;
Checking CheckingAccount;
Savings SavingsAccount;
public:
Customer();
Customer(int inID, int inPIN, string inName, string inAddress, string inPhone, int inZipCode,
string inCity, string inState);
//Reporters
inline int GetID() { return ID; }
inline int GetPIN() { return PIN; };
inline string GetName() { return Name; };
inline string GetCustomerInfo() { return (Address + City + State); };
inline int GetCheckingID() { return CheckingAccount.GetID(); }
inline int GetSavingsID() { return SavingsAccount.GetID(); }
inline double GetCheckingBal() { return CheckingAccount.GetBalance(); }
inline double GetSavingsBal() { return SavingsAccount.GetBalance(); }
inline double GetSavingsInt() { return SavingsAccount.GetIR(); }
inline char GetOverdraft() { if (CheckingAccount.GetOverdraftEnabled()) return 'Y'; else return 'N'; }
Checking& GetCheckingAccount() { return CheckingAccount; }
Savings& GetSavingsAccount() { return SavingsAccount; }
//Mutators
inline void SetID(int custid) { ID = custid; }
inline void SetPIN(int inPIN) { PIN = inPIN; };
inline void SetName(string inName) { Name = inName; };
inline void SetCheckingID(int id) { CheckingAccount.SetID(id); }
inline void SetSavingsID(int id) { SavingsAccount.SetID(id); }
inline void SetCheckingBal(double bal) { CheckingAccount.SetBalance(bal); }
inline void SetSavingsBal(double bal) { SavingsAccount.SetBalance(bal); }
inline void SetSavingsInt(double intr) { SavingsAccount.SetIR(intr); }
inline void SetOverdraft(bool od) { CheckingAccount.SetOverdraftEnabled(od); }
inline void CheckingDeposit(double n) { CheckingAccount.Deposit(n); }
inline void SavingsDeposit(double n) { SavingsAccount.Deposit(n); }
inline void CheckingWithdraw(double n) { CheckingAccount.Withdraw(n); }
inline void SavingsWithdraw(double n) { SavingsAccount.Withdraw(n); }
};