Skip to content

Sheffield | 26-Jan-ITP| Mona-Eltantawy | Sprint 1 | Coursework/ Sprint1#1109

Open
Mona-Eltantawy wants to merge 10 commits intoCodeYourFuture:mainfrom
Mona-Eltantawy:coursework/sprint-1-
Open

Sheffield | 26-Jan-ITP| Mona-Eltantawy | Sprint 1 | Coursework/ Sprint1#1109
Mona-Eltantawy wants to merge 10 commits intoCodeYourFuture:mainfrom
Mona-Eltantawy:coursework/sprint-1-

Conversation

@Mona-Eltantawy
Copy link

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

@Mona-Eltantawy Mona-Eltantawy 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 +8 to +11
line 3 is updating the value of the count variable by adding 1 to its current value.
The = opperator is an assignment opperator that assigns the result of the expression on the right (count+1) to the varibale on the left (count).
so, if count was 0 befor line 3 is excuted it will be 1 after line 3 is excuted.
And if it was 1 it will be 2 after line 3 is excuted. 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?

// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.

let initials = ``;
let initials = (firstName[0] + middleName[0] + lastName[0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why wrap the expression in a pair of parentheses? The syntax is still valid. It is just not a normal practice.

Comment on lines +22 to +23
const ext = filePath.slice (lastSlashIndex + 1);
console.log(`The ext part of ${filePath} is ${ext}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the expected value of ext (according to the illustration given on line 6-7)?

Does the code on line 23 output the expected value of "ext"?

Comment on lines +15 to +19
there are 4 function calls in this File, they are in the following lines:
line 1: carPrice.replaceAll(",", "")
line 2: priceAfterOneYear.replaceAll(",", "")
line 3: Number(carPrice.replaceAll(",", ""))
line 4: Number(priceAfterOneYear.replaceAll(",", ""))
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 more than 4 function calls.

Comment on lines 43 to +44
// e) What do you think the variable result represents? Can you think of a better name for this variable?
variable result represents the formatted remaining movielength time in hours, minutes, and seconds (HH:MM:SS).
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 think of a better name for this variable?

Comment on lines +41 to +44
5. const pence = paddedPenceNumberString
.substring(paddedPenceNumberString.length - 2)
.padEnd(2, "0");
This line extracts the last two characters (representing pence) and ensures they are exactly two digits long by padding with trailing zeros if necessary, resulting in "99".
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

@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