Skip to content

Calculator — implement UI, operations, and keyboard support #161

Description

@venisha-kalola

Project slug (e.g., snake, todo)

calculator

Summary

Build the calculator MVP using vanilla JS. Provide a display, a button grid, click handlers, and full keyboard support.

Details / Acceptance criteria

Acceptance Criteria:

  • Supports +, −, ×, ÷, =, ., AC (clear), CE/backspace, +/- (sign), %.
  • Prevents multiple decimals in a number.
  • Gracefully handles divide-by-zero.
  • Reasonable float rounding (e.g., 10–12 significant digits).
  • Keys 0–9, + - * / . Enter/Return, Escape (AC), Backspace (CE) work.
  • Responsive layout; display truncates/scrolls without breaking.

Files:

  • projects/calculator/index.html
  • projects/calculator/styles.css
  • projects/calculator/main.js

Tasks:

  • Build display + grid layout.
  • Wire button clicks and keyboard events.
  • Implement operation state machine (current, previous, operator).
  • Add formatting/rounding helpers.
  • Add ARIA labels and focus styles.

Scope

  • UI changes
  • Logic changes
  • Accessibility
  • Tests (manual)

Activity

  1. chandra-011220 commented on Oct 26, 2025

    @chandra-011220
    Contributor

    @venisha-kalola please assign this issue to me

  2. Glynis1314 commented on Oct 26, 2025

    @Glynis1314
    Contributor

    @venisha-kalola can you assign this to me

  3. Pramod-Munnoli commented on Oct 27, 2025

    @Pramod-Munnoli
    Contributor

    Hello! I’m new to open source and would love to contribute during Hacktoberfest.
    Can you please assign this issue to me? I’ll start working on it right away. 🚀

  4. Pramod-Munnoli commented on Oct 27, 2025

    @Pramod-Munnoli
    Contributor

    Thanks for assigning! I’ve started on this under a new branch feat/calculator-ui.
    I’ll push the implementation and open a PR once it’s ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions