A budget tracker

The problem

Build a program that keeps track of income and spending from typed commands, and gives a clear report by category.

Requirements

Technologies

Step by step

  1. Decide on the shape of one transaction, and write one by hand.
  2. Write a function that adds a transaction to the list, and test it with assert.
  3. Write functions that work out the balance and the total for each category.
  4. Write the report function, using format codes to line up the columns.
  5. Write the loop that reads a command and calls the right function.
  6. Add try and except around converting numbers, with helpful messages.
  7. Add a dictionary of commands in place of a chain of if statements.
  8. Test unusual inputs: no transactions, unknown categories and negative amounts.

Expected result

A program you can run and type commands into, which never crashes on bad input and always shows correct totals.

How it is evaluated

Ways to improve it