Spring 2024 - CS301P - 1
Spring 2024 - CS301P - 1
01
Total Marks: 20
SEMESTER Spring 2024
Due Date: 30-April, 2024
CS301P- Data Structures (Practical)
Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
o The assignment is submitted after the due date.
o The submitted code does NOT compile.
o The submitted assignment is other than .CPP file.
o The submitted assignment does NOT open or file is corrupted.
o The assignment is copied (from other student or ditto copy from handouts or internet).
Uploading instructions
For clarity and simplicity, you are required to Upload/Submit only ONE .cpp file.
GOOD LUCK
Marks: 20
You are required to implement a simple Task Management System using Linked List Data structure. The
program must meet the following requirements.
1. Write a C++ program that allows users to manage a Task Management System.
2. The program will contain a Task class, Node class and List class. The List will be responsible for
managing a linked list of tasks and performing various operations on it.
3. The Task class represents individual tasks in the to-do list. It contains a description of the task and
provides methods to set and get the description.
4. The Node class represents each node in the linked list. Each node contains a task and a pointer to the next
node.
Here's are the functions of the List class.
a) Adding Tasks: The addTask() function adds a new task to the linked list, you have to add the following
tasks into linked with the help of addTask() method named as:
Task 1
Task 2
Task 3
Task 4
Task 5
b) Displaying Tasks: The displayTasks() function displays all the tasks stored in the linked list, like:
c) Removing Tasks: The removeTask() function removes a task with the specified description from the
linked list.
5. After the removal of the task the displayTasks() function again will print the remaining Task with count.
Note: You must follow the following program structure for naming and to build the program. Also, while
displaying output STUDENT OWN VUID should also be displayed as given in Complete Sample Output
Screenshot. Otherwise, you will get ZERO marks.
Program Structure:
class: Task
Attributes:
1. String description
Constructor:
1. Task (…)
Functions:
1. getDescription()
2. setDescription(…) //Where … represents function takes parameters.
class : Node
Attributes:
1. Task* task
2. Node* next
Constructor:
1. Node (…)
Destructor:
1. ~Node ()
Functions:
1. getTask()
2. getNext()
3. setNext(…) //Where … represents function takes parameters.
class : List
Attributes:
1. Node* head
Constructor:
1. List()
Destructor:
1. ~List();
Functions:
1. addTask(…) //Where … represents function takes parameters.
2. displayTasks ()
3. removeTask(…) //Where … represents function takes parameters.
Default Function:
1. main()