0% found this document useful (0 votes)
24 views5 pages

Spring 2024 - CS301P - 1

Uploaded by

riazasif202
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

Spring 2024 - CS301P - 1

Uploaded by

riazasif202
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment No.

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.

Note: Use ONLY Dev-C++ IDE.


Objective
The objective of this assignment is

o To make you familiar of Programming with Linked List Data Structure.

For any query about the assignment, contact at [email protected]

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.

6. Use Object oriented programing principles where applicable.


An output screenshot is given at the end of this file for your complete understanding and reference.

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()

Complete Sample Output:


Lectures Covered: This assignment covers Lab # 1. (First three lectures of CS301).
Deadline: Your assignment must be uploaded/submitted at or before, April 30, 2024.

You might also like