Function change scope verification
You asked an AI assistant to add a `discount` parameter to your existing `calculatePrice(items)` function in JavaScript. It returned a new version of the function — but it's 30 lines where yours was 12, and it also reformatted everything and seems to have changed how tax is calculated. How do you verify it did what you asked and nothing you didn't, before accepting the change?
Implement
calculate_price_cents(unit_price_cents: list[int], quantities: list[int], discount_percent: int) → intExamples
in
[[1000,250],[2,4],0]out3255in
[[1000,250],[2,4],10]out2929in
[[],[],20]out0What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 10 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.