-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tasks.cpp
78 lines (67 loc) · 1.05 KB
/
Tasks.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
73
74
75
76
77
78
#include "Tasks.h"
Tasks::Tasks()
{
Id = 0;
}
void Tasks::AddTask()
{
cin.ignore();
cout << "Enter Task To Add: ";
cin.getline(task, 200);
cout << "Enter Id (only integers) : ";
cin >> Id;
}
int& Tasks::GetId()
{
return Id;
}
void Tasks::SetId(int id)
{
Id = id;
}
void Tasks::ModifyTask()
{
cin.ignore();
cout << "Enter new statement for Task To Add: ";
cin.getline(task, 200);
}
void Tasks::SetStatus()
{
int choice = 0;
do
{
cout << "Press 1 for Complete\n"
<< "Press 2 for Uncomplete\n";
cin >> choice;
switch (choice)
{
case 1:
{
string a = "Complete";
for (int i = 0; i < a.size(); i++)
{
status[i] = a[i];
}
}
break;
case 2:
{
string a = "Uncomplete";
for (int i = 0; i < a.size(); i++)
{
status[i] = a[i];
}
}
break;
default:
cout << "Invalid Input!!!";
break;
}
system("pause");
system("cls");
} while (choice != 1 && choice != 2);
}
void Tasks::ShowTask(int count)
{
cout << count << " " << left << setw(7) << Id << setw(50) << task << setw(20) << status << endl;
}