Glasgow | 26-ITP-May | Christelle Boten | Sprint 1 | Coursework#1514
Open
Christelle-b wants to merge 14 commits into
Open
Glasgow | 26-ITP-May | Christelle Boten | Sprint 1 | Coursework#1514Christelle-b wants to merge 14 commits into
Christelle-b wants to merge 14 commits into
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.
3 similar comments
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.
hey-hammad
reviewed
Jul 16, 2026
|
|
||
| console.log(num); | ||
|
|
||
| // Here, Math.random creates a random number between 0 to 1 and Math.floor rounds down to the nearest integer. |
There was a problem hiding this comment.
Try breaking the expression down further and explain the rationale behind each part, especially why we use maximum - minimum + 1 and add minimum at the end. The goal is to explain the logic, not just the outcome.
hey-hammad
reviewed
Jul 16, 2026
| // 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 are two function calls here. replaceAll and console.log |
There was a problem hiding this comment.
There are more than 2 function calls here, please revisit the documentation/course to review function declarations.
hey-hammad
reviewed
Jul 16, 2026
| //Line 1, line 2, line 7 and line 8 have variable declarations | ||
|
|
||
| // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | ||
| //This expression removes the comma in the price from 10,000 to 10000 |
There was a problem hiding this comment.
please mention the purpose of this expression as well.
hey-hammad
reviewed
Jul 16, 2026
| // The variable result shows the total remaining duration of a movie in terms of hours, minutes and seconds. We can also call it remainingTime. | ||
|
|
||
| // f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer | ||
| // The movieLength code will work work with all kinds of number. That is integers and floats. It will not work with strings No newline at end of file |
There was a problem hiding this comment.
try testing different edge cases and be more specific about what happens with different types of values (e.g. decimals, negative numbers, or unexpected inputs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self checklist
Changelist
I did all the the exercises requested.
Questions