c# · level 2 check
a budget tracker.
Time to build a real app: a budget tracker. You type commands, one per line. The tracker keeps every money-in and money-out entry in a list, reports where your money went, and saves everything to a file, so nothing is lost when the program ends.
The commands are `earn`, `spend`, `list`, `report`, `save`, `load` and `quit`, in any capitals. `earn` and `spend` ask what the money was for and how much. `list` shows every entry in tidy columns. `report` shows what came in and went out, the spending for each label from A to Z, and what is left. `save` writes `budget.csv`, and `load` reads it back.
Each entry is a record holding an enum and its own `ToString`. A bad label or amount throws your own `BadEntryException`, which the app catches and explains kindly. When the typed answers run out, the tracker quits by itself. Fill in each `____` with what you learned in every unit, then run it and try your own commands.
Fill in every ____ then run the checks.
- 1 It adds money in and out and lists ituses: collections
- 2 It reports spending by label, sorteduses: linq
- 3 It explains bad entries kindlyuses: exceptions
- 4 It saves to a file and loads it backuses: files
- 5 It copes when nothing has been saved yetuses: files
- 6 It takes any capitals and stops when the answers run outuses: null
Take as long as you like and try as many times as you want.
c# · level 2 · medium
level up.
You passed every check. Your face is now B).
- 28 lessons in this level
- 6 of 6 checks passed
This pass isn’t saved. A free account keeps your new face.