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 Java, instead of global variables, we usually use class fields. At the top of your class, you’ll declare fields that store your app’s data.
We’ll keep a tiny in-memory data model:
// Globals (top of your file)private static double income = 0.0;// A list of expense entries, each stored as a Map<String, Object>private static List<Map<String, Object>> expenses = new ArrayList<>();
Here are the conventions that we’ll use here:
Positive amounts only.
Built-ins only, pure Java (with no external libraries, no file I/O, and no advanced classes beyond simple POJOs). ...