Conversation
…them and does not run them.
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cjyuan
left a comment
There was a problem hiding this comment.
Code looks good. I just have a few comments.
| //const 24hourClockTime = "20:53"; | ||
| // I predict the code will give an error because a variable name cannot start with a number. | ||
| const twelveHourClockTime = "8:53pm"; No newline at end of file |
There was a problem hiding this comment.
Your understanding is correct. There were two variable declarations in the original code though.
| // c) The % operator gives the remainder after dividing movieLength by 60. | ||
| // c) The % operator gives the remainder after dividing movieLength by 60. 60 represents the number of seconds in one minute. | ||
| // d) It subtracts the remaining seconds from the movie length and then divides by 60 to convert the remaining seconds into total minutes. | ||
| // e) The variable result represents the movie duration in hours, minutes and seconds. A better name would be movieDuration. |
There was a problem hiding this comment.
The name movieDuration does not quite indicate the value stored in the variable
is a formatted string in the form "2:12:02".
Could you suggest a more descriptive name?
| What is the return value of `prompt`? | ||
| Calling the alert function displays a pop-up message to the user. | ||
|
|
||
| Calling the prompt function asks the user for information. The return value of prompt is the information the user entered. |
There was a problem hiding this comment.
When a program uses prompt() to ask the user for input, how can it tell whether the user clicked "OK" or "Cancel"?
| // In this exercise, you will need to work out what num represents? | ||
| // Try breaking down the expression and using documentation to explain what it means | ||
| // It will help to think about the order in which expressions are evaluated |
There was a problem hiding this comment.
I just noticed you missed this exercise.
Could you give a precise description what each of these expressions does, and the range of the numbers it may produce?
Math.random()Math.random() * (maximum - minimum + 1)Math.floor(Math.random() * (maximum - minimum + 1))Math.floor(Math.random() * (maximum - minimum + 1)) + minimum
Note: To describe a range of numbers, we could use the concise and precise interval notation:
[,]=> inclusion(,)=> exclusion
For example,
$x$ is a number between 1 and 10, including 1 but excluding 10.

Learners, PR Template
Self checklist
Task code
CYF-1039
Changelist
Completed All Sprint2 exercises