Skip to content
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

Input Validation and Error Handling #1165

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

Conversation

MakaremHind
Copy link

Description:

This pull request adds important input validation checks to improve the robustness and user experience of the calculator application. The following enhancements were implemented:

  • Prevent Multiple Decimal Points:

    Prevents users from entering multiple decimal points within a single number, which could lead to invalid inputs or parsing errors.

  • Prevent Consecutive Operators:

    Prevents users from adding two operators consecutively.

  • Division by Zero Check:

    Adds validation to handle division by zero, displaying an error message when a user attempts to divide by zero.

The code is now more resilient to unexpected user inputs, providing a smoother and more reliable user experience.

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.

1 participant