From 28593d24dc4be9cef9adb9055711147d857a67ad Mon Sep 17 00:00:00 2001 From: MOHIT TIWARI <163675793+mohit23ucs172@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:49:35 +0530 Subject: [PATCH] Feature: Implement fully functional responsive web calculator This commit introduces a complete, single-file HTML/JS calculator application. It resolves the requirements for basic arithmetic operations, input state management, and display constraints. Key functional aspects implemented: - Enforces a strict 8-digit input limit. - Implements 'C' (Clear Entry) and 'AC' (All Clear). - Displays 'ERR' for division by zero and number overflow exceeding 8 digits, as specified. - Uses a responsive and modern Tailwind CSS layout. Resolves #938 Resolves #931 --- Projects/1-Beginner/Calculator-App.md | 2 +- .../1-Beginner/calculator_mohit23ucs172.md | 317 ++++++++++++++++++ checks.json | 1 + 3 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 Projects/1-Beginner/calculator_mohit23ucs172.md create mode 100644 checks.json diff --git a/Projects/1-Beginner/Calculator-App.md b/Projects/1-Beginner/Calculator-App.md index be10ecbb..61118fb0 100644 --- a/Projects/1-Beginner/Calculator-App.md +++ b/Projects/1-Beginner/Calculator-App.md @@ -58,5 +58,5 @@ number. - [Javascript Calculator](https://codepen.io/giana/pen/GJMBEv) - [React Calculator](https://codepen.io/mjijackson/pen/xOzyGX) - [Javascript-CALC](https://github.com/x0uter/javascript-calc) -- [Sample Calculator](https://sevlasnog.github.io/sample-calculator) +- [Sample Calculator](https://www.google.com/search?q=https://github.com/bradtraversy/vanilla-js-projects/tree/master/calculator) - [Python Calculator](https://github.com/kana800/Side-Projects/tree/master/1-Beginner/calculator) diff --git a/Projects/1-Beginner/calculator_mohit23ucs172.md b/Projects/1-Beginner/calculator_mohit23ucs172.md new file mode 100644 index 00000000..b55a7432 --- /dev/null +++ b/Projects/1-Beginner/calculator_mohit23ucs172.md @@ -0,0 +1,317 @@ +Simple Web Calculator (HTML, Tailwind CSS, JavaScript) +This document provides the complete, self-contained code and a detailed description for a responsive web-based calculator. This application demonstrates essential front-end skills including UI layout, event handling, and maintaining state in pure JavaScript. + +Features +Basic Arithmetic: Supports addition, subtraction, multiplication, and division. + +8-Digit Limit: Input and output numbers are limited to 8 significant digits. + +Error Handling: Displays ERR for results that exceed the 8-digit limit (e.g., 99,999,999+1) or for division by zero. + +Responsive Design: Uses Tailwind CSS for a modern, mobile-friendly interface. + +Clear Functions: + +AC (All Clear): Resets the entire calculator state. + +C (Clear Entry): Clears the current input value only. + +Source Code (calculator.html) +This is a single-file implementation containing all HTML structure, Tailwind CSS styling, and JavaScript logic. + + + + + + + Responsive Calculator + + + + + + + + +
+ + +
+
0
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + diff --git a/checks.json b/checks.json new file mode 100644 index 00000000..8b70b53d --- /dev/null +++ b/checks.json @@ -0,0 +1 @@ +{"enabled":true,"categories":{}} \ No newline at end of file