-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from piyushnbali/piyushnbali-patch-1
this our group c++ code ver 1
- Loading branch information
Showing
8 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# TO-DO-List | ||
this is codegym project |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
#include <iostream> | ||
#include<vector> | ||
#include<ctime> | ||
#include<string> | ||
using namespace std; | ||
class manager | ||
{ public: | ||
vector<string> tasks; | ||
vector<int> dtSaved; | ||
vector<int>monthSaved; | ||
vector<int> hour; | ||
vector<int> 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"<<endl; | ||
cout<<"\nHours="; | ||
cin>>hours; | ||
cout<<"\nminutes="; | ||
cin>>minutes; | ||
hour.push_back(hours); | ||
min.push_back(minutes); | ||
|
||
} | ||
void propeties::display() | ||
{ | ||
cout<<"\n\n*************ALL TASKS*******************************************************************"; | ||
for(int i=0;i<tasks.size();i++) | ||
{ | ||
cout<<"\n\t"<<i+1<<". "<<"\t"<<tasks[i]<<"\t"<<hour[i]<<":"<<min[i]<<endl; | ||
cout<<"\n********************************************************************************************"<<endl;} | ||
} | ||
void propeties::update() | ||
{ | ||
time_t now = time(0); | ||
tm *ltm = localtime(&now); | ||
int taskno,t; | ||
string s; | ||
display(); | ||
cout<<"\nwhich one do you want to update?"<<endl; | ||
cin>>taskno; | ||
cout<<"\nEnter new task"<<endl; | ||
cin>>s; | ||
tasks[taskno-1]=s; | ||
cout<<"\nEnter new time hour"<<endl; | ||
cin>>t; | ||
hour[taskno-1]=t; | ||
cout<<"\nEnter new ti me minutes"<<endl; | ||
cin>>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?"<<endl; | ||
cin>>taskno; | ||
taskno=taskno-1; | ||
|
||
cout<<"\nAre you sure you want to delete?y/n"<<endl; | ||
cin>>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"<<endl; | ||
cin>>options; | ||
switch(options){ | ||
case 1: cout<<"\nEnter task"<<endl; | ||
cin>>task; | ||
p.add(task); | ||
break; | ||
case 2: p.display(); | ||
break; | ||
case 3: p.update(); | ||
break; | ||
case 4: p.del(); | ||
break; | ||
case 5: return 0; | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<CodeBlocks_project_file> | ||
<FileVersion major="1" minor="6" /> | ||
<Project> | ||
<Option title="todolist" /> | ||
<Option pch_mode="2" /> | ||
<Option compiler="gcc" /> | ||
<Build> | ||
<Target title="Debug"> | ||
<Option output="bin/Debug/todolist" prefix_auto="1" extension_auto="1" /> | ||
<Option object_output="obj/Debug/" /> | ||
<Option type="1" /> | ||
<Option compiler="gcc" /> | ||
<Compiler> | ||
<Add option="-g" /> | ||
</Compiler> | ||
</Target> | ||
<Target title="Release"> | ||
<Option output="bin/Release/todolist" prefix_auto="1" extension_auto="1" /> | ||
<Option object_output="obj/Release/" /> | ||
<Option type="1" /> | ||
<Option compiler="gcc" /> | ||
<Compiler> | ||
<Add option="-O2" /> | ||
</Compiler> | ||
<Linker> | ||
<Add option="-s" /> | ||
</Linker> | ||
</Target> | ||
</Build> | ||
<Compiler> | ||
<Add option="-Wall" /> | ||
<Add option="-fexceptions" /> | ||
</Compiler> | ||
<Unit filename="main.cpp" /> | ||
<Unit filename="testfile.cpp" /> | ||
<Unit filename="testfile1" /> | ||
<Extensions> | ||
<code_completion /> | ||
<envvars /> | ||
<debugger /> | ||
<lib_finder disable_auto="1" /> | ||
</Extensions> | ||
</Project> | ||
</CodeBlocks_project_file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|