You already know how to work with AI — now put it into practice. First ask AI to generate a ready-made calculator, then complete 20 tasks to improve it one by one.
Where to start
Before starting the tasks — ask AI to generate a basic calculator. Use this prompt:
Change the color of operator buttons
The +, −, ×, ÷ and = buttons should be a different color — for example orange or blue. This makes them instantly visible among the digits.
Add a calculator title
There should be a heading above the buttons, for example "My Calculator". You can write any name you like.
Change the overall style to your taste
Change the page background, font, or button border-radius. Make it look the way you like — it's your calculator.
Button press animation
When you press a button it should slightly "sink in". This makes the calculator feel alive and pleasant to use.
Theme toggle
Add a 🌙 / ☀️ button — it switches between dark and light view. Everything smoothly changes color on click.
Theme is saved
If you selected dark theme and reloaded the page — dark theme should remain. The browser should remember the choice.
Division by zero — show "Error"
Right now the calculator shows "Infinity" when dividing by zero. Replace that with a clear "Error" message in red.
Prevent two decimal points in one number
If a number already has a decimal point and you press it again — nothing should happen. One decimal point per number.
⌫ button — delete last character
Add a ⌫ (backspace) button. Press it — the last entered character is deleted. If nothing remains — show "0".
% button — calculates percentages
Add a % button. Example: type 200 + 10% = and get 220. Useful for discount and markup calculations.
"Copy result" button
Add a small 📋 button next to the display. Press it — the result is copied to the clipboard. "Copied!" appears on screen for a second.
Show last 5 calculations
Below the calculator a list appears: the last 5 examples and their results. For example: "2 + 3 = 5".
History persists after reload
Closed the tab, opened it again — history is still there. The browser remembers all your calculations.
Show time of each calculation
Next to each history entry add the time when the calculation was done. For example: "14:32".
Click on an entry — inserts the result
Clicked on a history entry — its result appears on the display. You can immediately continue calculating.
Clear history button with confirmation
Add a "Clear History" button. On click a popup appears: "Are you sure?" with "Yes" and "No" buttons.
Keyboard support
You can calculate without clicking buttons with the mouse: digits from the keyboard, Enter = calculate, Escape = reset, Backspace = delete a character.
Display digit size
Add two small buttons A+ and A−. Press A+ — digits on the display get larger. A− — smaller.
Looks good on mobile
Open the calculator on a phone or narrow the browser window — it should be comfortable. Large buttons, everything fits on screen.
"Engineering mode" button
Add a toggle that reveals an extra row of buttons: √ (square root), x² (square). Press again — the row hides.