-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
51 lines (46 loc) · 1.5 KB
/
main.cpp
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
#include "UPIManager.h"
#include <iostream>
#include <ctime>
#include <cstdlib>
int main() {
srand(static_cast<unsigned>(time(0)));
UPIManager upiManager;
User currentUser("", "", 0.0, "", "");
int choice;
do {
std::cout << "1. Register\n2. Login\n3. Initiate Payment\n4. View Transactions\n5. Admin Functions\n6. Check Balance\n7. Exit\n";
std::cout << "Enter your choice: ";
std::cin >> choice;
switch (choice) {
case 1:
upiManager.registerUser();
break;
case 2:
if (upiManager.loginUser(currentUser)) {
std::cout << "Login successful!" << std::endl;
} else {
std::cout << "Invalid username or password!" << std::endl;
}
break;
case 3:
upiManager.initiatePayment(currentUser);
break;
case 4:
upiManager.viewTransactionStatus();
break;
case 5:
upiManager.adminFunctions();
break;
case 6:
upiManager.checkBalance(currentUser);
break;
case 7:
std::cout << "Exiting..." << std::endl;
break;
default:
std::cout << "Invalid choice!" << std::endl;
break;
}
} while (choice != 7);
return 0;
}