Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 1 | Structuing and Testing Data#1072
Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 1 | Structuing and Testing Data#1072dcostaprakash wants to merge 1 commit intoCodeYourFuture:mainfrom
Conversation
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.
There was a problem hiding this comment.
Correct!
You can think about this further: What happens if the file path doesn't have a file extension?
| // Function Math.random() generates a decimal number between 0 to 1 which is 0 to 0.9999 | ||
| // Funcion (maximum-minimum + 1). Therefore it is 100 - 1 + 1 = 100 | ||
| // The * sign will multiply the random number with 100 which becomes 0 to 99.99 | ||
| // The function Math.floor will round the new number to the nearest whole number. Hence it will be 0 to 99 |
There was a problem hiding this comment.
"Round to nearest whole number" is inaccurate; it should be unconditionally rounded down.
There was a problem hiding this comment.
Understood. Done the change.
There was a problem hiding this comment.
Does any different between use const let and var?
There was a problem hiding this comment.
Yes. The difference is when we know the value, we use Const, we cannot change it. We use let if the value will change and Var if it is undefined.
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators | ||
|
|
||
| // % 60 is a remainder operator which in this case divides the total by 60 and shares the remainder (seconds / minutes) | ||
| // d) Interpret line 4, what does the expression assigned to totalMinutes mean? |
There was a problem hiding this comment.
Yes, but it might not be accurate enough.
There was a problem hiding this comment.
Understood. I made the change
|
|
||
| // The variable result represents the time of the movie in Hours Mintutes and seconds. We could use time instead of result | ||
| // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer | ||
| // Yes. This code will work for all values of movie length. I tried with 8400 seconds and 8405 seconds No newline at end of file |
There was a problem hiding this comment.
Do you consider different type value? (NaN, Decimals (e.g., 8784.5)....)
| // 1. const penceString = "399p": initialises a string variable with the value "399p" | ||
| // 2. Line 3 Removes the letter p from the end of the string | ||
| // 3. Line 8 keeps the length to 3 and adds a 0 if the length is smaller like 50p -> 050 or 5p -> 005 | ||
| // 4. Line 9 displays pounds from the 1st digit of the 3 |
There was a problem hiding this comment.
The phrase "pounds from the first digit of the 3" is not precise enough.
Changelist
I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
My changes meet the requirements of the task
I have tested my changes
My changes follow the style guide
my coursework