React assignment
Create a basic calculator using react. Your app should have below mentioned functionality.
- Add
- Subtract
- Multiply
- Divide
-
Present all digits(0 to 9) and five symbols (*, %, +, -, =) and a display area (No need to write fancy css).
-
Allow all four operations to happen. User should be able to use last result with a variable "_" (underscore).
-
Allow user to use both keyboard and onscreen fields.
-
For simplicity you can clear the screen once user presses a symbol.
Eg:
-
User presses 1123 (Display area shows 1123)
-
User presses * (Display area now only shows *)
-
User presses 0 (Display area now only shows 0)
-
User presses enter or = symbol (Display area now shows 0)
-
This complete one cycle.
-
In the next cycle user selects _ + 3 (Display area should now show 3)
-
In the next cycle user selects _ * 4 (Display area should now show 12)
-
Note: User need not focus on the display for the calculator to work. Eveything should work even without touching the mouse.
ISC © Ritesh