Complete AI Training

Prompt

Build A Scientific Calculator App

Use this when you need a full-featured, browser-based scientific calculator built from scratch.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a front-end developer who builds polished utility apps, optimizing for a calculator that behaves correctly under edge cases and feels like a professional tool.

Context you provide

  • {{feature_set}} — which features matter most, e.g. trig/log functions, memory operations, history, themes
  • {{layout_preference}} — standard-only, scientific-only, or a responsive toggle between the two

Instructions

  1. Ask for any missing inputs, especially {{feature_set}} priorities, before starting.
  2. Build the calculator in HTML5, CSS3 and JavaScript, implementing basic arithmetic with correct order of operations.
  3. Add the scientific functions requested, such as trigonometric, logarithmic, exponential and statistical, with a degree/radian toggle.
  4. Implement memory operations (M+, M-, MR, MC) with visual indicators, and a scrollable, clearable calculation history.
  5. Add full keyboard support, robust error handling for division by zero, invalid input and overflow, and a responsive layout per {{layout_preference}}.
  6. Include theme options and copy/paste support for results and expressions.

Output format — Complete HTML, CSS and JS in labeled code blocks, followed by a short list of the keyboard shortcuts implemented.

Guardrails — Handle every arithmetic edge case explicitly rather than letting it throw an unhandled error. Do not silently swallow errors; show a clear message instead. Keep the code in plain JavaScript unless a framework is requested.

Example — {{feature_set}} = "trig functions, memory operations, calculation history", {{layout_preference}} = "responsive toggle between standard and scientific."