LearnAI
Новинки AI · Код без программиста · Lesson 7/10
← To the catalog
Task

Mini-application: calculator that calculates

Describe the calculator so that it counts. Return JSON {"build":"what kind of calculator","inputs":"input fields with units","formula":"calculation rule with example","done_when":"how to check"}. In formula add a reference example.

Unlock access to submit solutions for instant AI review.
Make a working tool
💡 A piece of theory

A calculator is an ideal first tool: it has a clear input, a simple rule, and a clear output. Any mini-program works the same way: it receives data, applies a rule, and shows the result. AI needs to know three things - what a person enters (input fields), what formula to calculate and what to show as output; If you miss one, you’ll get a blank that doesn’t count. List the input fields with units (amount in rubles, term in months), describe the formula in words (“multiply the amount by the percentage and divide by 12”) and indicate the format of the result (number, rounding, signature). Describe the formula through a specific example - “if you entered 1000 and 10%, the result should be 100”: such a standard example works better than a dry formula, the AI ​​checks itself against it, and then you check it too. Immediately ask for processing of an empty field and text instead of a number, otherwise the first inconvenient input will break the calculator. A common mistake is to describe the interface but forget the formula. Beautiful fields without calculation are a picture, not a tool.

How is it assessed · passing 70

  • 1Valid JSON without text around it25%
  • 2There are fields build, inputs, formula, done_when30%
  • 3There is a formula with a standard example45%
Your promptClaude ⌄
🔒

Unlock access to submit solutions for instant AI review.