Search⌘ K

Build with Prompts

Create the core features of the Budget Tracker project in this lesson.

In the previous lesson, you:

  • Chatted with a simulated client and gathered needs.

  • Converted notes into functional requirements.

  • Created a clean skeleton of eight method stubs.

Now, we’ll bring it to life. We’ll start with two core methods, and then use AI to scaffold the rest. You’ll also get quick tests and a full reference solution.

We’ll keep a tiny in-memory data model:

In C++, we can use a few global variables to support our CLI prototype. At the top of the file, we’ll define the program’s memory, which stores the data that everything the Budget Tracker needs to run.

Here’s what our small in-memory model will look like:

// Globals (top of your file)
double g_income = 0.0;
// A growing list of expenses
vector<Expense> g_expenses;

Each expense will be represented by a small struct—a lightweight container that groups related information together:

struct Expense {
string category;
double amount;
string note;
};
...