Skip to content

Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 1 | Structuing and Testing Data#1072

Open
dcostaprakash wants to merge 1 commit intoCodeYourFuture:mainfrom
dcostaprakash:coursework/sprint-1
Open

Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 1 | Structuing and Testing Data#1072
dcostaprakash wants to merge 1 commit intoCodeYourFuture:mainfrom
dcostaprakash:coursework/sprint-1

Conversation

@dcostaprakash
Copy link

@dcostaprakash dcostaprakash commented Feb 25, 2026

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

@github-actions

This comment has been minimized.

@dcostaprakash dcostaprakash added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 25, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 25, 2026
@github-actions

This comment has been minimized.

@dcostaprakash dcostaprakash added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 26, 2026
@WeiTsungCheng WeiTsungCheng added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 28, 2026
Copy link

@WeiTsungCheng WeiTsungCheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, but could be better.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Round to nearest whole number" is inaccurate; it should be unconditionally rounded down.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. Done the change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does any different between use const let and var?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it might not be accurate enough.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase "pounds from the first digit of the 3" is not precise enough.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. i made the change.

@WeiTsungCheng WeiTsungCheng added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants