-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (39 loc) · 733 Bytes
/
main.cpp
File metadata and controls
50 lines (39 loc) · 733 Bytes
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
#include <iostream>
#include "todo_list.h"
using namespace std;
int main(int argc, char const *argv[])
{
TodoList tasks("list.txt");
while(true)
{
tasks.read();
if (tasks.get_count() > 0)
{
tasks.display();
cout << endl;
cout << "1) Add" << endl;
cout << "2) Clear" << endl;
cout << "3) Check" << endl;
cout << "Choice: ";
string choice;
getline(cin, choice);
if (choice == "1")
{
tasks.add();
} else if (choice == "2") {
tasks.clear();
} else if (choice == "3") {
tasks.check();
} else {
break;
}
} else {
cout << "Created a new list .." << endl;
tasks.create();
cout << endl;
tasks.display();
tasks.save();
}
}
return 0;
}