DIP02 Calculator is a web-based calculator application. It provides basic arithmetic operations with a clean and responsive user interface(UI).
- Basic arithmetic operations: addition, subtraction, multiplication, division
- Percentage calculation
- Positive/negative toggle
- Decimal point support
- Clear function (AC)
- Responsive design for various screen sizes
The project consists of three main files:
index.html
: The main HTML structure of the calculatorstyle.css
: CSS file for styling the calculatorscript.js
: JavaScript file containing the calculator's logic
To use the calculator:
- Open the
index.html
file in a web browser. - Click on the buttons to input numbers and operations.
- Press '=' to calculate the result.
- Use 'AC' to clear the display and start a new calculation.
The HTML file creates the basic structure of the calculator, including:
- A display area to show the current input and results
- Buttons for digits 0-9
- Buttons for arithmetic operations (+, -, ×, ÷)
- Special function buttons (AC, +/-, %, .)
The CSS file provides styling for the calculator, including:
- A dark theme with orange accent colors
- Responsive grid layout for buttons
- Hover and active states for buttons
- Flexible display area for showing calculations
The JavaScript file handles the calculator's logic, including:
- Input handling for digits and decimal point
- Implementation of arithmetic operations
- Display updating
- Clear function
- Error handling for invalid operations