Skip to content

Commit

Permalink
Calculator: Fix backticks and parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
softy-dev authored Oct 30, 2024
1 parent c54888c commit 7f664ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions foundations/javascript_basics/project_calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Here are some use cases (expectations about your project):
- Add a "clear" button.
1. Create the functions that populate the display when you click the digit buttons. You should store the content of the display (the number) in a variable for use in the next step.
1. Make the calculator work! You'll need to store the first and second numbers input by the user and then `operate()` on them when the user presses the `=` button, according to the operator that was selected between the numbers.
- You should already have the code that can populate the display, so once `operate()` has been called, update the display with the result of the operation.
- This is the hardest part of the project. You need to figure out how to store all the values and call the operate function with them. Don't feel bad if it takes you a while to figure out the logic.
- You should already have the code that can populate the display, so once `operate` has been called, update the display with the result of the operation.
- This is the hardest part of the project. You need to figure out how to store all the values and call the `operate` function with them. Don't feel bad if it takes you a while to figure out the logic.
1. Gotchas: watch out for and fix these bugs if they show up in your code:
- **Your calculator should not evaluate more than a single pair of numbers at a time.** Example: you enter a number (`12`), followed by an operator button (`+`), a second number button (`7`), and a second operator button (`-`). Your calculator should then do the following: first, evaluate the initial pair of numbers (`12 + 7`), then display the result of that calculation (`19`). Finally, use that result (`19`) as the first number in a new calculation, along with the next operator (`-`). An example of the behavior we're looking for can be seen in this [student's calculator live preview](https://mrbuddh4.github.io/calculator/).
- You should round answers with long decimals so that they don't overflow the display.
Expand Down

0 comments on commit 7f664ef

Please sign in to comment.