diff --git a/TO-DO-List/README.md b/TO-DO-List/README.md new file mode 100644 index 0000000..787cae1 --- /dev/null +++ b/TO-DO-List/README.md @@ -0,0 +1,2 @@ +# TO-DO-List +this is codegym project diff --git a/TO-DO-List/todolist/bin/Debug/todolist.exe b/TO-DO-List/todolist/bin/Debug/todolist.exe new file mode 100644 index 0000000..9ed9b4c Binary files /dev/null and b/TO-DO-List/todolist/bin/Debug/todolist.exe differ diff --git a/TO-DO-List/todolist/main.cpp b/TO-DO-List/todolist/main.cpp new file mode 100644 index 0000000..720335a --- /dev/null +++ b/TO-DO-List/todolist/main.cpp @@ -0,0 +1,133 @@ +#include +#include +#include +#include +using namespace std; +class manager +{ public: + vector tasks; + vector dtSaved; + vectormonthSaved; + vector hour; + vector min; +}; +class propeties:public manager +{ public: + void add(string s); + void update(); + void del(); + void display(); + + void displayReport(); + +}; + + + + +void propeties::add(string s) +{ int hours,minutes; + time_t now = time(0); + tm *ltm = localtime(&now); + dtSaved.push_back(ltm->tm_mday); + monthSaved.push_back(ltm->tm_mon); + tasks.push_back(s); + cout<<"\nEnter time"<>taskno; + cout<<"\nEnter new task"<>s; + tasks[taskno-1]=s; + cout<<"\nEnter new time hour"<>t; + hour[taskno-1]=t; + cout<<"\nEnter new ti me minutes"<>t; + min[taskno-1]=t; + dtSaved[taskno-1]=ltm->tm_mday; + monthSaved[taskno-1]=ltm->tm_mon; + + +} +void propeties::del() +{ + display(); + int taskno; + char a; + cout<<"\nWhich task you want to delete?"<>taskno; + taskno=taskno-1; + + cout<<"\nAre you sure you want to delete?y/n"<>a; + if(a=='y') + {tasks.erase(tasks.begin()+taskno); + hour.erase(hour.begin()+taskno); + min.erase(min.begin()+taskno); + dtSaved.erase(dtSaved.begin()+taskno); + monthSaved.erase(monthSaved.begin()+taskno);} + else{return;} + +} + +int main() +{ + + int options; + string task; + propeties p; + while(true) + { + cout<<"\nEnter 1.New task 2.Display 3.Update 4.Delete 5.Report 6.Exit"<>options; + switch(options){ + case 1: cout<<"\nEnter task"<>task; + p.add(task); + break; + case 2: p.display(); + break; + case 3: p.update(); + break; + case 4: p.del(); + break; + case 5: return 0; + + + } + + } + + + + + + + + + + +} diff --git a/TO-DO-List/todolist/obj/Debug/main.o b/TO-DO-List/todolist/obj/Debug/main.o new file mode 100644 index 0000000..9774178 Binary files /dev/null and b/TO-DO-List/todolist/obj/Debug/main.o differ diff --git a/TO-DO-List/todolist/obj/Debug/testfile.o b/TO-DO-List/todolist/obj/Debug/testfile.o new file mode 100644 index 0000000..1e5212c Binary files /dev/null and b/TO-DO-List/todolist/obj/Debug/testfile.o differ diff --git a/TO-DO-List/todolist/testfile.cpp b/TO-DO-List/todolist/testfile.cpp new file mode 100644 index 0000000..d3f5a12 --- /dev/null +++ b/TO-DO-List/todolist/testfile.cpp @@ -0,0 +1 @@ + diff --git a/TO-DO-List/todolist/todolist.cbp b/TO-DO-List/todolist/todolist.cbp new file mode 100644 index 0000000..d453950 --- /dev/null +++ b/TO-DO-List/todolist/todolist.cbp @@ -0,0 +1,45 @@ + + + + + + diff --git a/TO-DO-List/todolist/todolist.depend b/TO-DO-List/todolist/todolist.depend new file mode 100644 index 0000000..df64699 --- /dev/null +++ b/TO-DO-List/todolist/todolist.depend @@ -0,0 +1,5 @@ +# depslib dependency file v1.0 +1574182513 source:c:\users\pnbal\desktop\todolist\testfile.cpp + +1574182513 source:e:\to-do-list\todolist\testfile.cpp +