Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
abdishakoor-dev
left a comment
There was a problem hiding this comment.
Thanks for redoing the branch, it is clean now.
There are some issues to fix here:
-
2-mandatory-errors/1.js,2.jsand4.jsall still stop with an error when you run them. See my comment on each. -
1-key-exercises/3-paths.js, see my comment. -
1-key-exercises/4-random.js, see my comment. -
3-mandatory-interpret/1-percentage-change.jsanswer a), see my comment. -
3-mandatory-interpret/2-time-format.jsline 1 has been changed from the original, see my comment. -
3-mandatory-interpret/2-time-format.jsanswers b) and f), see my comment. -
Could you run Prettier over the
Sprint-2folder? Six of the files are not formatted at the moment.
Add the Needs Review label again when you have pushed.
| @@ -2,3 +2,4 @@ | |||
|
|
|||
| const age = 33; | |||
| age = age + 1; | |||
There was a problem hiding this comment.
Your explanation on line 5 is right. Run the file though. It still stops with the same error, because line 3 is still const. This section wants the code fixed as well as explained.
| @@ -3,3 +3,4 @@ | |||
|
|
|||
| console.log(`I was born in ${cityOfBirth}`); | |||
| const cityOfBirth = "Bolton"; | |||
There was a problem hiding this comment.
Your explanation on line 6 is right. This file still stops when you run it though. What would you move, so that line 4 prints "I was born in Bolton"?
| @@ -1,2 +1,4 @@ | |||
| const 12HourClockTime = "8:53pm"; | |||
There was a problem hiding this comment.
You are right about why this happens. Both names are still here though, so node cannot read the file at all. What would you rename them to?
There was a problem hiding this comment.
The file runs now, good. Line 2 now says "20:53pm", but the original was "20:53". A 24-hour time does not use pm. Please put the original value back.
The two names are also the same apart from a capital H. Could you pick names that show which clock is which?
|
|
||
| // https://www.google.com/search?q=slice+mdn No newline at end of file | ||
| const startDirIndex = filePath.lastIndexOf("Users"); | ||
| const dir = filePath.slice(startDirIndex, lastSlashIndex); |
There was a problem hiding this comment.
Run this file and look at the dir line. It prints Users/mitch/... but the path starts with a /, so one character is missing. Two things to think about. Which index does lastIndexOf("Users") give you? And what happens to this code if the path does not contain the word Users at all? Your ext on lines 9 and 10 is a good example of the approach that would work here.
There was a problem hiding this comment.
My first thought was that on the image "/ " was under the root and the dir starts from "home".
so, that is why I considered dropping the "/". But now I have fixed it.
| //num represents a number | ||
| //lets start by (maximum-minimum +1) which the output is 100. | ||
| //math.random()*100 returns random number between 0 and 100 | ||
| //math.floor()it rounds a number to thier nearest integer, |
There was a problem hiding this comment.
What does Math.floor(4.6) give you? And what does Math.round(4.6) give you? One of them rounds to the nearest whole number and the other does something else. Also, line 6 says num represents "a number". Can you be more exact about which numbers it can be?
There was a problem hiding this comment.
Math.floor(4.6) gives me the the largest integer between 4 and 4.6which is 4.
Math.round(4.6) always return a value between 0 and 1 that is decimal number. even if any value is provided for the method.
There was a problem hiding this comment.
Math.floor(4.6) is 4, you are right. But Math.round(4.6) is 5. Try it in node. The one that gives a number between 0 and 1 is Math.random().
So which one rounds to the nearest whole number? Line 11 still says Math.floor does.
Also line 6. What is the smallest value num can be? What is the largest?
| // d) Identify all the lines that are variable declarations | ||
|
|
||
| // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | ||
| // There are two function calls. line 4 and 5 |
There was a problem hiding this comment.
You have found the two lines, but the question asks how many function calls there are. Line 4 has two of them, one inside the other. What is Number(...) doing there, and what is replaceAll(...) doing? Then look at line 10 as well.
| @@ -1,4 +1,4 @@ | |||
| const movieLength = 8784; // length of movie in seconds | |||
| const movieLength = 3000; // length of movie in seconds | |||
There was a problem hiding this comment.
This was 8784 in the original. Trying another value is the right instinct, but put the original back. The program you are explaining should be the one you were given.
| //A.There are six variable declararions | ||
|
|
||
| // d) Interpret line 4, what does the expression assigned to totalMinutes mean? | ||
| //B. no function calls |
There was a problem hiding this comment.
b) says there are no function calls. Have a look at line 10. What is console.log(...) doing there?
And on f) at line 29: you say you tried various values. Try 59, then -60, then 90.5. What does each one print? Would you show a time that way?
There was a problem hiding this comment.
b) is right now.
For f), you say negative numbers and decimals do not work. What does the program print for -60? And for 90.5? Write one of those outputs in your answer, so it shows what goes wrong.
|
Ignore point 5 on my review, about putting |
abdishakoor-dev
left a comment
There was a problem hiding this comment.
Thanks for the changes. 1.js, 2.js and 4.js all run now, and the dir line in 3-paths.js is right.
A few things are still open:
-
1-key-exercises/4-random.jslines 6 and 11, see my reply on that thread. -
2-mandatory-errors/4.jsline 2, see my reply on that thread. -
3-mandatory-interpret/2-time-format.jsanswer f), see my reply on that thread. -
Prettier still flags
2-mandatory-errors/0.js. Please format that file.
Add the Needs Review label again when you have pushed.

Learners, PR Template
Self checklist
Task code
CYF-1039
Changelist
I have created a new pull request based on the instruction left on the comment section
Questions