Skip to content

TheAlmightyCrumb/calculator-challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Challenge-Calculator

Welcome! looks like our calculter broke down, please help us fix it!

how to start?

  1. clone the repo to your computer
  2. run npm i on your terminal
  3. start coding!

Template instructions

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.

Requirements:

  1. Calculator must have 20 buttons
  2. Should contain all numbers between 0-9 and a dot (.)
  3. AC button that clears the result screen
  4. Equal button (=)
  5. It should also have a sqrt (√) and power (x²) buttons
  6. The calculator should return "Error" when the user tries to divide by zero
  7. 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)

important!

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!

final result

your result should look something like this
calculator

How to submit?

Just upload the link to your repoistory to our website, and we will check if your code has fixed our calculator!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.6%
  • CSS 21.7%
  • HTML 8.7%