Welcome to the Task Management System! This application provides a simple and effective way to manage your tasks. You can create, view, edit, and delete tasks through a user-friendly interface. The program utilizes file storage to maintain task information, offering options to sort and filter tasks based on different criteria.
This Task Management System was developed as part of a second-semester project for the course "Object Oriented Programming" at FAST NUCES Karachi. The project aims to apply essential object-oriented programming concepts and techniques learned during the course.
- Task Management: Easily create, view, edit, and delete tasks.
- Sorting and Filtering: View tasks sorted by date, priority, or category.
- Error Handling: Robust input validation to prevent incorrect entries.
- File Storage: Save tasks to a file and retrieve them upon startup.
Example of the task creation interface where users input task details.
-
Main Menu:
- Create Task: Add a new task with details such as title, priority, date, etc.
- View Tasks: Display tasks sorted by date, priority, or category.
- Edit Task: Update task details, such as priority or status.
- Delete Task: Remove a task by its ID.
- Exit Program: Close the application safely.
-
Controls:
- Enter numbers to select menu options.
- Input task details when prompted.
-
Objective: Efficiently manage tasks to boost productivity and stay organized.
-
Error Handling: The system will alert you if an invalid input is detected, allowing for correction.
To compile and run the application, follow these steps:
-
Clone the repository:
git clone https://github.com/SHaiderM16/Task-Management-System.git
-
Navigate to the project directory:
cd Task-Management-System
-
Compile the code:
g++ -o taskmanager src/main.cpp src/Task.cpp src/TaskManager.cpp
-
Run the program:
./taskmanager
The program relies on two main classes: Task
and TaskManager
.
Task
Class
This class represents individual tasks and includes attributes such as task ID, title, description, deadline, priority, status, category, and label.
TaskManager
Class
The TaskManager
class handles various task-related operations, providing functionalities for creating, viewing, editing, and deleting tasks. It interfaces with a file system to persist task data.
-
Key Functions:
createTask()
: Prompts the user to enter details for a new task and saves the task to the designated file.viewTask(int sortingMethod)
: Displays tasks based on the selected sorting criteria:1
for sorting by date2
for sorting by priority3
for sorting by category
editTaskPriorityAndStatus(int taskId)
: Updates the priority and status of a task specified by its ID.deleteTask(const std::string &filename, int taskID)
: Removes a task identified by its ID from the specified file.
Here's a quick look at some core functions used in the program. For the full code, please check the source files in the repository.
void TaskManager::createTask()
{
Task newTask;
cin >> newTask; // Utilize the operator>> to input task details
// Load existing tasks from the file
ifstream infile("project.txt");
if (infile.is_open())
{
string line;
while (getline(infile, line))
{
stringstream ss(line);
string idStr;
getline(ss, idStr, ',');
int id = stoi(idStr);
// Skip tasks with the same ID as the one being added
if (id == newTask.getTaskID())
{
cout << "Task with the same ID already exists! Please choose a different ID." << endl;
infile.close();
return;
}
}
infile.close();
}
// Add the task to the task manager
tasks.push_back(newTask);
cout << "Task created successfully!" << endl;
// Save the task to txt file
saveTaskToFile("project.txt", newTask.getTaskID());
}
void TaskManager::viewTask(int sortingMethod)
{
// Check the sorting method provided by the user
if (sortingMethod == 1)
{
// Call viewTasksByDate function if '1' is passed
viewTasksByDate();
}
else if (sortingMethod == 2)
{
// Call viewTasksByPriority function if '2' is passed
viewTasksByPriority();
}
else if (sortingMethod == 3)
{
// Call viewTasksByCategory function if '3' is passed
viewTasksByCategory();
}
}
This project is licensed under the MIT License - see the LICENSE file for details.
We plan to enhance the Task Management System with the following updates:
-
Graphical User Interface (GUI): Adding a GUI will make the application more user-friendly and visually appealing. This will involve designing an intuitive interface for task management and interactions.
-
Enhanced Error Handling: We aim to improve the robustness of the application by implementing more comprehensive error handling. This will include better validation of user inputs and more informative error messages to guide users effectively.
For any questions or feedback, please contact:
- Syed Haider Murtaza at [email protected]
- Muhammad Rayyan at [email protected]
- Mujtaba Kamran at [email protected]