# Build a simple calculator without becoming a developer

Original 5HO practice material. Fictional example. Reviewed 5 October 2026.

## Useful result

You'll finish with a tested local calculator with stated inputs and edge cases.

A small calculator is a good first build because you can check it with numbers you already understand. Start with one formula. A gradient and a confetti animation can wait until addition works.

## Set up

Allow 30–45 minutes. Use an AI tool that can produce code and save an HTML file, plus a desktop browser. You can copy code into a text editor if direct file download is unavailable.

## Practice input

Calculator: event catering estimate. Inputs: people, price per person, delivery. Formula: people × price + delivery. Example: 12 × 18 + 15 = AUD 231. Reject negative values and non-whole attendee counts.

## Do the task

1. Describe inputs, formula and validation before asking for code.
2. Save the single HTML file and open it locally, not only in the AI preview.
3. Test ordinary values, zero attendees, blank inputs, negative costs and a fractional headcount.

## Prompt

Build a standalone HTML catering calculator with embedded CSS and JavaScript, no external services. Show AUD totals, input labels and clear errors. Do not calculate until required fields are valid. Use the supplied formula and example.

## Refine

For zero attendees, show zero catering cost but retain the entered delivery charge. Explain that assumption on the page. Add no tracking or network requests.

## Expected checks

The sample must show AUD 231. Zero people with delivery 15 gives AUD 15 under the chosen rule. Negative inputs and a headcount of 2.5 should show an error.

## Save

Save calculator-v1.html and your test results. Keep a working copy before asking for any design changes.

## Sources

- Writing clear prompts: https://help.openai.com/en/articles/10032626-prompt-engineering-best-practices-for-chatgpt
