-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATM.h
More file actions
102 lines (83 loc) · 2.66 KB
/
ATM.h
File metadata and controls
102 lines (83 loc) · 2.66 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
//Defenitions
#define MAX_SIZE 100
#define NUMBER_OF_ACCOUNTS 10
#define ANSI_COLOR_RED "\e[0;91m"
#define ANSI_COLOR_GREEN "\e[0;92m"
#define ANSI_COLOR_YELLOW "\e[0;93m"
#define ANSI_COLOR_BLUE "\e[0;94m"
#define ANSI_COLOR_MAGENTA "\e[0;95m"
#define ANSI_COLOR_CYAN "\e[0;96m"
#define ANSI_COLOR_RESET "\x1b[0m"
//Customer's information
typedef struct CUSTOMER_INFO
{
char First_name[MAX_SIZE];
int ID;
int Password;
int Account_number;
char Bank_name[20];
int Credit;
} CUSTOMER_INFO;
typedef struct CUSTOMER_LIST
{
CUSTOMER_INFO Customer_info;
struct CUSTOMER_LIST *PNext;
struct CUSTOMER_LIST *PBefore;
} CUSTOMER_LIST;
typedef struct ATM
{
CUSTOMER_LIST Accounts[10];
int number_of_accounts;
} ATM;
//Function to help the customer to choose the desired operation
//Input:---
//Output:---
void HELP();
//Function to receive customer's id and password to find and access to customer's account
//Input:Customer's ID,Customer's password
//Output:---
int LOGIN(ATM *PHead);
//Function to de-allocate the space allocated by malloc function
//Input:---
//Output:---
void FREE(ATM *PHead);
//Function to write updated customer information
//Input:---
//Output:---
void WRITE(ATM *PHEAD);
//Function to load information of customers stored in a file
//Input:---
//Output:---
ATM* LOAD(char *file_name);
//Function to read information of customers stored in a file
//Input:---
//Output:---
void READ_FILE(ATM *PHead);
//Function for customer to deposit money and print receipt
//Input:Customer number
//Output:Transaction's receipt
void DEPOSIT(ATM *PHead, int Customer_number);
//Function for customer to withdraw money and print receipt
//Input:(deposited)Money
//Output:Transaction's receipt
void WITHDRAW(ATM *PHead, int Customer_number);
//Function for customer to transfer money to another valid bank account and print receipt
//Input:(withdrawn)Money, Customer number
//Output:Transaction's receipt
void TRANSFER(ATM *PHead, int Customer_number);
//Function to check account balance
//Input:Money to be transfered, name of destination bank, destination account number, Customer number
//Output:Transaction's receipt
void CHECK_BALANCE(ATM *PHead, int Customer_number);
//Function to print transaction's receipt
//Input:Customer number
//Output:Transaction's receipt
void PRINT_RECEIPT(ATM *PHead, int Customer_number);
//Function to print customer's last 10 transation
//Input:Customer number, selected transaction(by customer)
//Output:Receipt of customer's last 10 transaction
int LAST_10_TRANSACTION(ATM *PHead, int Customer_number, char operation[20]);