Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .instructions/2. core exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Let's start by running the application to learn what it does.

3. Add a new line below this comment and type the following two lines. You should see GitHub Copilot start to autocomplete the second line as you type. When you see this, just press ```TAB``` to accept the completion.

``` <!-- add a button for a power (or exponential) function --> ```
``` <button class="btn" onClick="operationPressed('^')">^</button> ```
``` <!-- add a button for a percentage function --> ```
``` <button class="btn" onClick="operationPressed('%')">%</button> ```

Your finished snippet should match the following.
Your finished snippet should match the following. If not, see how you can ask Copilot to revise the line by specifying the funciton name `operationPressed`.

<img width="538" alt="GitHub Copilot suggestions" src="../assets/index-html.png">

Expand All @@ -64,7 +64,7 @@ Your finished snippet should match the following.

8. Start typing the following line and notice that GitHub Copilot should start to offer code completion half way through the word "power" as you're typing. Press **TAB** to accept the suggestion.

```'power': function(a, b) { return Math.pow(a, b) },```
```'percentage': function(a, b) { return (Number(a) / 100) * Number(b) },```

9. Open the ```public/client.js``` file in the editor window.

Expand All @@ -86,7 +86,7 @@ Your completed addition should match the following.

14. Enter ```npm start``` in the terminal window and press **ENTER** to run the application.

15. You should test the new button by clicking 3, then the "^" (power) button, then click 2. Click "=" and the result should be 9.
15. You should test the new button by clicking 5, then the "%" (percentage) button, then click 10. Click "=" and the result should be 0.5. You might want to ask for a rounding for the result too.

16. Close the browser window, return to the Terminal window in Codespaces and press ```CTRL+C``` to terminate the application.

Expand Down
Binary file modified assets/Add-operator-completed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/case-suggestion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/index-html.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.