From 7f664ef9e696c1257869f219200b7df298ea875f Mon Sep 17 00:00:00 2001 From: nekosoffy <161766793+nekosoffy@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:01:29 -0300 Subject: [PATCH] Calculator: Fix backticks and parenthesis --- foundations/javascript_basics/project_calculator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/foundations/javascript_basics/project_calculator.md b/foundations/javascript_basics/project_calculator.md index 648b414807..27c46ad4ba 100644 --- a/foundations/javascript_basics/project_calculator.md +++ b/foundations/javascript_basics/project_calculator.md @@ -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.