-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskManager.h
More file actions
29 lines (24 loc) · 769 Bytes
/
TaskManager.h
File metadata and controls
29 lines (24 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// TaskManager.h
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
struct Task {
std::string name;
std::string description;
int priority;
bool completed;
Task(const std::string& taskName, const std::string& taskDescription, int taskPriority)
: name(taskName), description(taskDescription), priority(taskPriority), completed(false) {}
};
class TaskManager {
public:
void createTask(const std::string& name, const std::string& description, int priority);
void displayTasks();
void markTaskAsCompleted(int index);
void sortTasksByPriority();
void saveTasksToFile(const std::string& filename);
void loadTasksFromFile(const std::string& filename);
private:
std::vector<Task> tasks;
};