Skip to content

Commit

Permalink
Merge pull request #29179 from KHenkel95/new-calculator-gotcha
Browse files Browse the repository at this point in the history
project_calculator: Add new bug to watch out for in "Gotchas" section
  • Loading branch information
wise-king-sullyman authored Dec 11, 2024
2 parents 74a89c5 + 8711772 commit a765642
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions foundations/javascript_basics/project_calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Here are some use cases (expectations about your project):
- Pressing `=` before entering all of the numbers or an operator could cause problems!
- Pressing "clear" should wipe out any existing data. Make sure the user is really starting fresh after pressing "clear".
- Display a snarky error message if the user tries to divide by 0... and don't let it crash your calculator!
- Make sure that your calculator only runs an operation when supplied with two numbers and an operator by the user. Example: you enter a number (`2`), followed by an operator button (`+`). You press the operator button (`+`) a second consecutive time. Your calculator should not evaluate this as (`2 + 2`) and should not display the result (`4`). If consecutive operator buttons are pressed, your calculator should not run any evaluations, it should only take the last operator entered to be used for the next operation.

#### Extra credit

Expand Down

0 comments on commit a765642

Please sign in to comment.