Project Description

Write a simple todo list application. This will require use of classes, objects, and possibly structs. Here are the requirements:

1. Menu-driven - upon running the program, the user should be prompted to press one of the following:

  • View all Todos in list

2. Remove a todo item from the list

  • if there are not any todos, the user should be prompted and sent back to the menu
  • choose a todo from list based on title to delete
- 1. Pick up milk
- 2. Drop off son at baseball

3. Add a todo item to the list

  • Take user input and add a todo to the list

4. Complete a todo item

  • similar to delete, the user is shown a list of their todo items, and upon choosing one, the item is marked Done (true)
  • user should be prompted accordingly

5. Quit

2. Todo item should be a class with the following private members:

  • Title - String
  • Done - Bool (true if done, false otherwise)
  • Todo class should have the following public functions:

Private

  • getTitle - return the todo's title
  • toggleTodo - toggle Done variable from true to false or vice-versa

When first running the program, an empty todo list (array) should be created for storing todo items as they're added. When displaying todo items from the list (delete and toggle methods above), simply display their index within the list and add one (1). After a user chooses a todo to delete or toggle, use that menu-choice and subtract one (1) to find the item in the list (array).

I'll get you started with some sudo code:

// Prototype class

class Todo {
private:
string title;
bool done;

public:
string getTitle();
bool toggleTodo();
}

//Implementations
string Todo::getTitle() {
return title;
}

bool Todo::toggleTodo() {
return !done;
}

// Prototype functions (up to you to implement - see below)
void deleteTodo(int);
Todo addTodo(string, bool);

int main(){}
void deleteTodo(int todoIndex){}
Todo addTodo(string todoTitle, bool todoDone = false){}
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.