Skip to content

Fix: Added input validation and error handling in calculator (#1164) #1198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

niveditasargar
Copy link

Description

Fixes #1164 by adding proper input validation and error handling in the calculator app.

Fixes Implemented:

  • ✅ Invalid operator usage (e.g., 5++3)
  • ✅ Multiple decimals in a number (e.g., 3.4.2)
  • ✅ Division by zero (e.g., 5/0)

Screenshots

Invalid Operator Usage
sct1

Invalid Decimal Usage
sct2

Division by Zero
sct3

Notes

  • Logic added in index.js
  • All validations show proper error messages
  • Tested manually, all test cases passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lack of Input Validation and Error Handling in Calculator
1 participant