London | 26-ITP-May | Bisrat Tesfay| Sprint 1 | Coursework #1383
London | 26-ITP-May | Bisrat Tesfay| Sprint 1 | Coursework #1383B3-Bisrat wants to merge 5 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Joshuafolorunsho
left a comment
There was a problem hiding this comment.
Lovely work over all.
Clear answers, good use of console.log to check your values.
Just a couple of small things to mull over.
| // num creates a random whole number between 1-100 (inclusive). | ||
| // Try breaking down the expression and using documentation to explain what it means | ||
| //maximum-minimum+1 gives us the number of possible values (100-1+1 = 100) | ||
| //Math.random() gives us a random decimal number between 0 (inclusive) and 1 (exclusive) | ||
| //Multiplying Math.random() by 100 gives us a random decimal number between 0 and 100 (exclusive) | ||
| //Math.floor() rounds down the random decimal number to the nearest whole number. | ||
| //Adding minimum to the result gives us a random whole number between minimum and maximum (inclusive) |
There was a problem hiding this comment.
I really like how you explained this bit.
| const 24hourClockTime = "20:53"; | ||
| const twelveHourClockTime = "8:53pm"; | ||
| const twentyFourHourClockTime = "20:53"; | ||
| //variables can't start with a number. To fix this, we need to change the variable name to something that starts with a letter or an underscore. |
There was a problem hiding this comment.
Brilliant! Just out of curiosity, If you start with a dollar sign ($), would this error out as well?
There was a problem hiding this comment.
No, in JavaScript variables can start with sign ($). I didn't know about this, thank you for letting me find out.
| // Line 4 and line 5 are variable reassignment statements. In line 4, carPrice is being reassigned with the new value after removing the comma and converting it to a number. In line 5, priceAfterOneYear is being reassigned in the same way. | ||
|
|
||
| // d) Identify all the lines that are variable declarations | ||
| // Line 1 and line 2 are variable declarations. In line 1, carPrice is declared and initialized with the string value "10,000". In line 2, priceAfterOneYear is declared and initialized with the string value "8,543". |
There was a problem hiding this comment.
Good answer for lines 1 and 2, but have another scan through the whole file: are there any other lines that also declare a new variable with const or let?
There was a problem hiding this comment.
You might have missed this question.
There was a problem hiding this comment.
You might have missed this question.
This comment has been minimized.
This comment has been minimized.
Hi @B3-Bisrat, Could you please fix the problem here so I can re-review? Thank you. |
aab0047 to
fa849fa
Compare
|
Well done @B3-Bisrat ! |
Learners, PR Template
Self checklist
Changelist
I have completed all the coursework/sprint one tasks.
Questions