-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstaff.h
64 lines (60 loc) · 1.8 KB
/
staff.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
#pragma once
#include "BST_Tree.h"
#include "Hashtable.h"
void staff()
{
BST_Tree t;
Hashtable h;
int condition = 0;
while (condition != 5)
{
cout << "Welcome staff" << endl;
cout << "Choose one of the following options:" << endl;
cout << "1. View transaction history" << endl;
cout << "2. Transfer" << endl;
cout << "3. Withdraw" << endl;
cout << "4. Deposit" << endl;
cout << "5. Exit" << endl;
cin >> condition;
if (condition == 1)
{
}
else if (condition == 2)
{
int senderaccountno = 0, receiveraccountno = 0, amount = 0;
cout << "Please enter sender account number: " << endl;
cin >> senderaccountno;
cout << "Please enter receiver account number: " << endl;
cin >> receiveraccountno;
cout << "Please enter amount: " << endl;
cin >> amount;
t.transfer(senderaccountno, receiveraccountno, amount);
}
else if (condition == 3)//withdraw
{
int accountno = 0, amount = 0;
cout << "Please enter account number: " << endl;
cin >> accountno;
cout << "Please enter amount: " << endl;
cin >> amount;
t.withdraw(accountno, amount);
}
else if (condition == 4)
{
int accountno = 0, amount = 0;
cout << "Please enter account number: " << endl;
cin >> accountno;
cout << "Please enter amount: " << endl;
cin >> amount;
t.deposit(accountno, amount);
}
else if (condition == 5)
{
condition = 5;
}
else
{
cout << "Invalid input" << endl;
}
}
}