-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.cpp
More file actions
46 lines (44 loc) · 1.08 KB
/
Copy pathmenu.cpp
File metadata and controls
46 lines (44 loc) · 1.08 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
#include "menu.h"
void showActions() {
printf("\n");
printf("Choose one of the following actions\n");
printf("1 - Insert new task\n");
printf("2 - Edit task\n");
printf("3 - Mark task as done\n");
printf("4 - Delete task\n");
printf("5 - Load\n");
printf("6 - Save\n");
printf("7 - Quit\n");
}
void checkChosenAction(int opt, std::vector<std::string> *list, std::unordered_set<int> * doneList) {
switch (opt)
{
case 1:
printf("You choose insert a new task\n");
addItemToList(list);
break;
case 2:
printf("You choose edit a task\n");
changeListElement(list);
break;
case 3:
markElementAsDone(doneList, list);
break;
case 4:
deleteListElement(list, doneList);
break;
case 5:
loadList(list, doneList);
break;
case 6:
saveList(list, doneList);
break;
case 7:
printf("You choose to quit the application. Goodbye.\n");
exit(1);
break;
default:
printf("Invalid option\n");
break;
}
}