-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAmazon_client.cpp
More file actions
89 lines (75 loc) · 1.5 KB
/
Amazon_client.cpp
File metadata and controls
89 lines (75 loc) · 1.5 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
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#include "Amazon.h"
int main()
{
Amazon *A = new Amazon("India");
int op;
do
{
cout << "\n----------------------------------------------------------\n";
cout << "Select the operation that you want to perform: \n";
cout << "1.Register User\n2.Get User Details\n3.Get Transaction Details\n";
cout << "4.Update User Details\n5.Make Payment\n0.Exit\n\nChoice: ";
cin >> op;
switch(op)
{
case 1:
{
int is_registered = A->registerUser();
break;
}
case 2:
{
string user_id;
cout << "Enter ID: ";
cin >> user_id;
vector<string> user_details = A->getUserDetails(user_id);
cout << '\n';
for (auto it : user_details)
cout << it << " ";
cout << endl;
break;
}
case 3:
{
string transaction_id;
cout << "Enter ID: ";
cin >> transaction_id;
vector<string> transaction_deatils = A->getTransactionDetails(transaction_id);
cout << '\n';
for (auto it : transaction_deatils)
cout << it << " ";
cout << endl;
break;
}
case 4:
{
int is_updated = A->updateUserDetails();
break;
}
case 5:
{
int is_payment_made = A->makePayment();
break;
}
case 6:
{
break;
}
case 0:
{
cout << "\nExiting...\n\n";
break;
}
default:
{
cout << "\nInvalid choice\nPlease select correct operation number\n";
break;
}
}
} while(op != 0);
return 0;
}