Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
60 lines (55 loc) · 1.57 KB
/
Copy pathmain.cpp
File metadata and controls
60 lines (55 loc) · 1.57 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
#include <iostream>
#include <fstream>
#include<iomanip>
#include <string>
#include "functions.h"
#include "Tasks.h"
using namespace std;
int main()
{
int id;
char choice;
do
{
system("cls"); //command for clearing the console screen each time we get to the menu
cout << "\nMain Menu" ;
cout << "\n\n 1. Add new Task" ;
cout << "\n 2. Open Task list";
cout << "\n 3. Edit the Task";
cout << "\n 4. Mark as complete" ;
cout << "\n 5. Close the Program";
cout << "\n Choose the option (1-5): ";
cin >> choice;
system("cls");
switch(choice)
{
case '1': // create new task and write it to a file
writeData();
break;
case '2':
displayData(); // This function shows the list of tasks
break;
case '3':
displayData();
cout<< "\n\nWhich task ID do you want to edit?\n";
cout << "ID: ";
cin >>id;
editTask(id);
break;
case '4':
displayData();
cout<< "\n\nWhich task ID do you want to complete? \nID: ";
cin >> id;
system("cls");
completeTask(id);
displayData();
break;
case '5':
break;
default :cout<<"\a";
}
cin.ignore();
cin.get();
}while(choice!='5');
return 0;
}