Skip to content

Sheffield | 26-Jan-ITP | Karim Mhamdi | Sprint 1 | Coursework/sprint-1#1092

Open
KKtech06 wants to merge 1 commit intoCodeYourFuture:mainfrom
KKtech06:courswork/Sprint-1
Open

Sheffield | 26-Jan-ITP | Karim Mhamdi | Sprint 1 | Coursework/sprint-1#1092
KKtech06 wants to merge 1 commit intoCodeYourFuture:mainfrom
KKtech06:courswork/Sprint-1

Conversation

@KKtech06
Copy link

@KKtech06 KKtech06 commented Feb 27, 2026

Learners, PR Template

Self checklist

  • 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

Changelist

I have completed all the tasks for the Sprint-1 and i have created a branch Coursework/Sprint1

Questions

N/A

@KKtech06 KKtech06 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 27, 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 27, 2026
@github-actions

This comment has been minimized.

@KKtech06 KKtech06 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 27, 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 27, 2026
@KKtech06 KKtech06 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 2026
Comment on lines +10 to +11
// Line 3 is updating the value of the count variable.
// The = operator is an assignment operator, which assigns the value on the right (count + 1) to the variable on the left (count). No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.

Can you find out what one-word programming term describes the operation on line 3?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the feedback I well work on it and and I well put a better description

Copy link
Contributor

Choose a reason for hiding this comment

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

Your description is good. I just want everyone to know the relevant programming term.

const dir = ;
const ext = ;
const dir = filePath.slice(0, lastSlashIndex);
const ext = filePath.slice(filePath.lastIndexOf(".")) ;
Copy link
Contributor

Choose a reason for hiding this comment

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

Code is correct.

On line 21, there are some trailing space characters.
Trailing spaces do not affect program execution, but they can influence how Git detects changes in a file.

If you enabled "Format on save" in VSCode, and you have installed "prettier" extension, VSCode can automatically indent the code and remove all trailing space characters.

Comment on lines +15 to +18
//Step 1 Generate a random decimal between 0 and 1
//step 2 multiplys the random decimal by 100 - 1 = 99 + 1 = 100
//step 3 math.floor makes it a whole number between 0 and 99
//step 4 adds 1 to make it a whole number between 1 and 100 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Phrases like "a number between X and Y" are not precise enough in a program specification, because they do not clearly state whether the endpoints X and Y are included.

We can use the concise and precise interval notation to describe a range of values.

  • [, ] => inclusion
  • (, ) => exclusion

For example, [1, 10) means, all numbers between 1 and 10, including 1 but excluding 10.

Comment on lines -4 to 5
console.log(`I was born in ${cityOfBirth}`);
console.log("I was born in Bolton");
const cityOfBirth = "Bolton";
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason you gave does not quite explain why the original code does not work.

What was the error message reported by the JS runtime?

// line 10 has a function call

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
// I have spotted the error in line 5 becouse there was a missing comma inside the brackets.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you revise the description to indicate where inside the brackets (parentheses) the comma is missing? (e.g., the comma is missing between the ___________ )

// line 8

// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
// The purpose of this expression is to remove the commas from the string value using the replaceAll().
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the Number( ... ) part?

// then divides the result by 60 to calculate the total full minutes.

// e) What do you think the variable result represents? Can you think of a better name for this variable?
// Result is a formatted time string in hours minutes and seconds.
Copy link
Contributor

Choose a reason for hiding this comment

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

There are two questions in part (e). Can you also answer the second question?

Comment on lines +28 to +29
// 4. Takes everything except the last 2 digits as pounds.
// 5. Prints the result in this format: £3.99
Copy link
Contributor

Choose a reason for hiding this comment

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

(4) and (5) does not quite describe the code on lines 14-16.

Also, could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?
In other words, do we really need .padEnd(2, "0") in this script?

What is the return value of `prompt`?
What effect does calling the `prompt` function have? The prompt function displays a popup box asking you to enter a text and pausing the page until you click ok or cancel.

What is the return value of `prompt`? Prompt returns the text entered by the user as a string if the user clicks cancel.
Copy link
Contributor

Choose a reason for hiding this comment

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

The answer does not look correct. Can you revise it?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 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