-
-
Notifications
You must be signed in to change notification settings - Fork 238
NW | 25-ITP-Sep | TzeMing Ho | Sprint 1 | coursework/sprint-1 #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
||
// Read the code and then answer the questions below | ||
|
||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing one function call in your list. Can you find it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.