-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.h
66 lines (53 loc) · 1.16 KB
/
user.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
60
61
62
63
64
65
66
#ifndef MINIPROJ_USER_H
#define MINIPROJ_USER_H
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
typedef struct user user;
typedef struct datee datee;
typedef struct transact transact;
typedef struct timee timee;
#define size 9000 //max number of users
#define histsize 100 //max number of transactions per user
struct datee
{
int dd;
int mm;
int yy;
};
struct timee
{
int hrs;
int min;
};
//datee and timee store user creation date and time
struct transact
{
long to;
long from;
double amt;
};
struct user
{
long ID;
double balance;
int transNum; //stores number of transactions done by user
transact history[histsize]; //stores user transaction history
datee join;
timee tim;
};
user userHash[size];
void initHash();
void makeUser();
long makeID();
void setDate(long);
void setTime(long);
void transaction();
void printHistory();
void updateHistory(long int from_ID, long int to_ID, double amount);
void update_trav(long int from_ID, long int to_ID, double amount);
void printUsers();
void GetUserHash();
void PutUserHash();
#endif