forked from hrabago/atm-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathATM_back.cs
149 lines (88 loc) · 2.16 KB
/
ATM_back.cs
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World");
myusr = User("hector", "password")
ATM myATM = new ATM("hector","password");
//double bal = myATM.getBalance();
Console.WriteLine(myATM.getBalance());
}
}
public class User{
private String name;
private String pw;
private Double balance;
public User(String user, String password){
}
public bool authUser(){
return true;
}
public double getBalance()
{
return balance;
}
public void addToBalance(Double deposit_amount)
{
balance = balance + deposit_amount;
}
}
public class ATM
{
private User usr;
private String pw;
private User Usr;
private int bills_1 = 0;
private int bills_5 = 0;
private int bills_10 = 0;
private int bills_20 = 500;
private int bills_50 = 0;
private int bills_100 = 0;
//private int total = bills_1 ...
//User constructor
public ATM(){
//User constructor
}
public ATM(User user)
{
//User constructor
// load database from csv file
}
//String constructor
public void login(User user)
{
// Authenticate user login
}
public void logout()
{
// log-out
}
public double getBalance()
{
return this.usr.getBalance();
//return 0.00 ;
}
public void withdrawCash()
{
//decrease user balance
}
public void depositFunds(Double amount)
{
// increase user balance
//bills_100 += amount / 100
//amount = amount / 100
//bills_50 += amount 50
//amount = amount % 50
//bills_20 += amount % 20
//amount = amount % 20
//bills_10 += amount % 10
//amount = amount % 10
//bills_5 += amount % 5
//amount = amount % 5
//bills_1 += amount
this.usr.addToBalance(amount);
}
public static void Main()
{
}
}