NW | 25-ITP-Sep | TzeMing Ho | Sprint 1 | coursework/sprint-1#706
NW | 25-ITP-Sep | TzeMing Ho | Sprint 1 | coursework/sprint-1#706TzeMingHo wants to merge 18 commits intoCodeYourFuture:mainfrom
Conversation
|
You show a very good understanding of variables, functions, and general programming syntax. Nice work! I left a few comments for you to respond to. |
|
Hi Jenny, Thank you for reviewing my pull request. |
Sprint-1/1-key-exercises/4-random.js
Outdated
| // Math.floor - Rounds a number DOWN to the nearest integer | ||
| // Math.random - generates a random floating number > 0 and < 1 | ||
| // (maximum - minimum + 1) = 100 - 1 + 1 = 100 | ||
| // So, num represents a rounded down random integer generated between 1 and 100 + 1 |
There was a problem hiding this comment.
Good job explaining. 🤔 Is the "+1" at the end of line 14 a typo?
num will be a number between 1-100 (inclusive)
There was a problem hiding this comment.
Hi Jenny,
You are right. I was not thinking of even the edge case, as Math.floor(99.99) + 1 = 99 + 1 = 100, has been rounded down. So, the num should have been between 1 and 100 inclusive.
I have updated the answer in 0da267c.
| @@ -13,10 +13,26 @@ console.log(`The percentage change is ${percentageChange}`); | |||
|
|
|||
| // a) How many function calls are there in this file? Write down all the lines where a function call is made | |||
There was a problem hiding this comment.
You're missing one function call in your list. Can you find it?
There was a problem hiding this comment.
Absolutely, I should have included the console.log function in the list. The console.log function is a built-in function that can also be called. I have updated the answer in 0da267c.
@TzeMingHo oh oops! I forgot to 'submit' my comments yesterday.. Sorry about that. Hopefully you can see them now? |
|
Great job @TzeMingHo 🙌 |
Learners, PR Template
Self checklist
Changelist
I have completed the 4 exercises in Sprint-1, including answering questions, fixing errors, interpreting, and exploring.