-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
72 lines (63 loc) · 1.63 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <iostream>
#include "User.h" // Include the header file for User class
#include "UserManager.h" // Include the header file for UserManager class
using namespace std;
int main()
{
int id;
string name;
int choice;
User ob;
while (true)
{
cout << "\n\t\tMain Menu\n";
cout << "1. Add user\n";
cout << "2. Remove user\n";
cout << "3. Task Manager\n";
cout << "4. List Users\n";
cout << "5. Exit\n";
cout << "Enter your choice (1-5): ";
cin >> choice;
if (choice == 5)
{
cout << "Exiting the program.\n";
break;
}
switch (choice)
{
case 1:
while (true)
{
cin >> id;
if (id == 0)
{
break;
}
else
{
getline(cin,name);
ob.userdetails(name, id);
}
}
break;
case 2:
cout << "Enter user id to remove: ";
cin >> id;
ob.removeuser(id);
break;
case 3:
cout << "Enter user id to print: ";
cin >> id;
ob.printuser(id);
ob.runTaskManager(id);
break;
case 4:
cout << ob;
break;
default:
cout << "Invalid choice." << endl;
break;
}
}
return 0;
}