The program use a circular linked list and data structures to store the tasks.
Every task should include a task name, a name for the person assigned to it, and the deadline for the task.
Variables should be dynamic and their sizes should be determined at runtime based on the length of user input.
You should implement the following functions (with appropriate arguments and return types) for your structure: add(), remove(), search(), and list().
The add()function should add tasks alphabetically by task name. You do not need to implement any file operations.
The search() function should be able search for a task by the task assignee name or the task name.
The list() function should print records to the screen in the order they appear in the circular linked list.
You should successfully deallocate all of the allocated memory before termination of your program.
void add(Node *&firstLooked)
{
string taskName;
string personName;
string time;
Node *current = new Node;
Node *additive = new Node;
current = firstLooked;
cout << "Please enter the task: ";
getline(cin, taskName);
additive->task = taskName;
cout << "Please enter name of person who does the task: ";
getline(cin, personName);
additive->person = personName;
cout << "Please enter the deadline like this: dd.mm.year : ";
getline(cin, time);
additive->date = time;
This code include lots of error. An output of code:
A: Add Task
S: Search for Task
L: List All Tasks
R: Remove Task
E: Exit
Choose an operation:
A
Please enter the task: Please enter name of person who does the task: John
Please enter the deadline like this: dd.mm.year : 12.03.2014
A: Add Task
S: Search for Task
L: List All Tasks
R: Remove Task
E: Exit
Choose an operation:
A
Please enter the task: Please enter name of person who does the task: William
Please enter the deadline like this: dd.mm.year : 14.02.2014
A: Add Task
S: Search for Task
L: List All Tasks
R: Remove Task
E: Exit
Choose an operation:
L
All tasks are listed below:
Process returned -1073741819 (0xC0000005) execution time : 41.936 s
Press any key to continue.
Where are my mistakes and what are they? This code is my fisrt code about linked list. So ı cannot found mistakes easily. I would appreciate if you could help.