London | 26-ITP-Jan | Abdul Moiz | Sprint 1 | Sprint-1#909
London | 26-ITP-Jan | Abdul Moiz | Sprint 1 | Sprint-1#909A-Moiz wants to merge 7 commits intoCodeYourFuture:mainfrom
Conversation
jenny-alexander
left a comment
There was a problem hiding this comment.
Hi @A-Moiz Good job demonstrating comprehension of these programming fundamentals. I left a few comments/questions for you to review.
| // It will help to think about the order in which expressions are evaluated | ||
| // Try logging the value of num and running the program several times to build an idea of what the program is doing | ||
|
|
||
| // Math.random() generates a random decimal number between 0 and 1. |
There was a problem hiding this comment.
Can you be more specific here about what Math.random() returns? Does it include 0 and 1? See if you can use the words 'inclusive' and 'exclusive' in your explanation.
There was a problem hiding this comment.
0 ≤ x < 1
x is more than or equal to 0 (inclusive) but less than 1 (exclusive)
| // Line 1 is a variable declaration, creating the count variable with an initial value of 0 | ||
| // Describe what line 3 is doing, in particular focus on what = is doing | ||
|
|
||
| // Line 3 is updating the value of the count variable by adding 1 to its current value |
There was a problem hiding this comment.
Yes, what you wrote is correct. + 1 is a common programming pattern that has a specific name to it. Can you research a bit and tell me what that is?
| // 6 variable declarations. | ||
|
|
||
| // b) How many function calls are there? | ||
| // 0 function calls. |
There was a problem hiding this comment.
There is 1 function call. Can you try to find it?
There was a problem hiding this comment.
Yes I found it, it was console.log(result)
|
All comments were well addressed. Good job! Note: Jennifer is not available these few days, so I am here to help check the changes. |
Learners, PR Template
Self checklist
Changelist
Added comments and answered the questions in Sprint 1 directory of this Repo
Questions
N/A