Skip to content

Commit

Permalink
Merge pull request #4 from piyushnbali/piyushnbali-patch-1
Browse files Browse the repository at this point in the history
this our group c++ code ver 1
  • Loading branch information
piyushnbali authored Nov 21, 2019
2 parents fae8b8e + 11cde95 commit b63a5c2
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TO-DO-List/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# TO-DO-List
this is codegym project
Binary file added TO-DO-List/todolist/bin/Debug/todolist.exe
Binary file not shown.
133 changes: 133 additions & 0 deletions TO-DO-List/todolist/main.cpp
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 added TO-DO-List/todolist/obj/Debug/main.o
Binary file not shown.
Binary file added TO-DO-List/todolist/obj/Debug/testfile.o
Binary file not shown.
1 change: 1 addition & 0 deletions TO-DO-List/todolist/testfile.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

45 changes: 45 additions & 0 deletions TO-DO-List/todolist/todolist.cbp
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>
5 changes: 5 additions & 0 deletions TO-DO-List/todolist/todolist.depend
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

0 comments on commit b63a5c2

Please sign in to comment.