Welcome! looks like our calculter broke down, please help us fix it!
how to start?
- clone the repo to your computer
- run npm i on your terminal
- start coding!
- at the end it should look like this:
In the template file you will get 2 components.
MathOperation - should get {type , onClick(function)} as props.
DigitButton - should get {value(0-9) , onClick(function)} as props.
- You can use operationTypes array to check what values are expected as props for MathOperation component.
- Calculator must have 20 buttons
- Should contain all numbers between 0-9 and a dot (.)
- AC button that clears the result screen
- Equal button (=), after pressing equal you should make sure you can use the result in the next calculation.
- It should also have a sqrt (√) and power (x²) buttons
- The calculator should return "Error" when the user tries to divide by zero
- The calculator should have the following functions:
- divide / (9/2 = 4.5)
- sum + (9+2 = 11)
- minus - (9-2 = 7)
- multiply * (9*2 = 18)
- modulo % (9%2 = 1)
- power x² (3² = 9)
- sqrt √x (√16 = 4)
In order to make the tests run properly, do not change the id's of the components, and make sure to use the right types and values!
- Its recommended to open windows calculator and check its behaviour, they should act the same.
your result should look something like this
Just upload the link to your repoistory to our website, and we will check if your code has fixed our calculator!
Please review our challenge so we could improve it! https://forms.gle/kruou5hvSL6DFQma9