-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecription.cpp
More file actions
32 lines (23 loc) · 1.96 KB
/
decription.cpp
File metadata and controls
32 lines (23 loc) · 1.96 KB
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
30
31
32
Certainly, here's a summary of the functions used in the simplified console-based task manager example provided earlier:
void addTask(const Task& task):
This function is a member of the TaskManager class. It takes a Task object as a parameter and adds it to the tasks vector,
which represents the list of tasks.
void listtasks():
Another member function of the TaskManager class.
It iterates through the tasks vector and displays the details of each task, including its title, description, and completion status.
void mark as completed(int index):
Also a member function of the TaskManager class.
This function takes an index as a parameter and marks the task at that index as completed by changing its completed status to true.
int main():
The main function where the execution of the program starts.
It initializes the TaskManager instance, creates some sample tasks, and enters a loop for displaying a menu to the user and processing their choices.
do-while loop:
The loop in the main function is used to repeatedly present a menu to the user until they choose to exit. The loop reads the user's choice, calls the appropriate function, and continues until the user chooses to exit.
switch statement:
Inside the loop in the main function, a switch statement is used to determine the action based on the user's choice. Depending on the choice, the program calls the relevant function (e.g., listTasks() or markTaskCompleted()).
std::cout and std::cin:
These are standard output and input streams, respectively, provided by the C++ Standard Library. They are used to display messages to the user and read their input from the console.
std::vector:
The std::vector container is used to store the list of tasks in the TaskManager class. It allows for dynamic storage and manipulation of tasks
struct Task:
A struct is used to define the structure of a task, including its title, description, and completion status. It's a simple way to group related data together