-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustomer.h
More file actions
62 lines (50 loc) · 1.76 KB
/
customer.h
File metadata and controls
62 lines (50 loc) · 1.76 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
#ifndef CUSTOMER_H
#define CUSTOMER_H
#include<iostream>
#include<vector>
struct AppConfig {
std::string admin_password;
double interest_rate;
double loan_charge;
double maintenance_charge;
double minimum_balance;
double minimum_balance_charge;
};
std::string encrypt(std::string &passwd);
//Template for customer information and abilities.
class customer{
private:
//customer information
long account_number;
std::string customer_name;
std::string customer_password;
double balance;
double loan_amount;
int password_attempts_remaining;
int account_status;
public:
//constructors
customer();
customer(long acc_no, std::string name, std::string passwd, double bal, double loan_bal, int attempts, int status);
//methods
void withdraw(const AppConfig& config);
bool withdraw(double amount, const AppConfig& config, bool silent = false);
void deposit();
bool deposit(double amount, bool silent = false);
void transfer(std::vector<customer>& all_customers, const AppConfig& config);
void change_password();
void view_balance();
void pay_loan(const AppConfig& config);
void edit_loan_amount(double loan);
void edit_password_attempts_remaining(int attempts);
void edit_account_status(int status);
//functions used to load data from csv to program
long get_account_number() const;
std::string get_customer_name() const;
std::string get_password() const;
double get_balance() const;
double get_loan_amount() const;
int get_password_attempts_remaining() const;
int get_account_status() const;
};
#endif