Skip to main content
ANVISoftware Solutions

To-Do List Application

Beginner4-6 hours

Manage a list that changes: add, complete, remove and display items. Your first program with real state.

Technologies

The brief

What the finished thing needs to do.

  • Add a task with a description
  • List all tasks with a number and whether each is complete
  • Mark a task complete by its number
  • Remove a task by its number
  • Handle a number that does not correspond to any task
  • Show a sensible message when the list is empty

How to structure it

Model a task as a class with a description and a completion flag, rather than keeping two parallel lists. This is the lesson the project exists to teach.

Hold the tasks in a List<Task>. Separate the menu handling from the operations on the list.

Note the difference between the number shown to the user, which starts at 1, and the list position, which starts at 0. Converting between them in one place avoids scattered off-by-one mistakes.

Why these technologies

A class for the task
Keeps the description and completion state together so they cannot drift apart.
List<T>
The number of tasks changes as the program runs, which an array cannot accommodate.

Build it in this order

Each stage produces something that works. That matters — a project that only runs at the very end is a project people abandon.

  1. Display a fixed list

    Create three tasks in code and print them numbered from 1.

  2. Add tasks from input

    A loop with a menu: add a task, or quit.

  3. Mark tasks complete

    Read a number, convert it to a position, and update the task.

  4. Handle invalid numbers

    Reject anything outside the valid range with a clear message, before using it as an index.

  5. Remove tasks

    Consider what happens to the numbering of the remaining items.

  6. Handle the empty list

    Every operation should behave sensibly when there is nothing there.

  7. Tidy up

    Extract each menu action into its own method.

Done means

How to know it is finished

Check each of these before moving on. If one fails, the project is not done yet — and that is useful information rather than a setback.

  • All four operations work and the display always reflects the current state
  • Entering an out-of-range or non-numeric task number is handled gracefully
  • An empty list produces a message rather than blank output or an error
  • Task description and completion state live in one class, not parallel collections

If you want to go further

Extensions worth attempting

Only once the core build meets every criterion above.

  • Save tasks to a file so they survive restarting the program
  • Add a due date and highlight overdue tasks
  • Support priorities and sort by them
  • Add a filter to show only incomplete tasks

Have a project worth talking through?

Tell us what you're building or what's slowing your current system down. We'll give you a direct read on scope and approach.