Skip to content

London | 26-ITP-May | Dipa Sarker | Sprint 1 | Coursework#1419

Open
Dipa-Sarker wants to merge 30 commits into
CodeYourFuture:mainfrom
Dipa-Sarker:Coursework/sprint-1
Open

London | 26-ITP-May | Dipa Sarker | Sprint 1 | Coursework#1419
Dipa-Sarker wants to merge 30 commits into
CodeYourFuture:mainfrom
Dipa-Sarker:Coursework/sprint-1

Conversation

@Dipa-Sarker

@Dipa-Sarker Dipa-Sarker commented Jun 28, 2026

Copy link
Copy Markdown

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

  • Completed all Exercises tasks.
  • Ran and explained the errors in the Errors section.
  • Interpreted the programs in the Interpret section.
  • Completed the Explore (Stretch) activity.
  • Tested the solutions locally before committing and pushing the changes.

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

This comment has been minimized.

@Dipa-Sarker Dipa-Sarker changed the title London | ITP May-26 | Dipa Sarker | Sprint- 1 | Sprint 1 Coursework London | ITP May-26 | Dipa Sarker | Sprint 1 | Sprint 1 Coursework Jun 28, 2026
@github-actions

This comment has been minimized.

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

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@Dipa-Sarker Dipa-Sarker changed the title London | ITP May-26 | Dipa Sarker | Sprint 1 | Sprint 1 Coursework London | 26-ITP-May | Dipa Sarker | Sprint 1 | Sprint 1 Coursework Jun 28, 2026
@github-actions

This comment has been minimized.

@Dipa-Sarker Dipa-Sarker added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 28, 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 Jun 28, 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 Jun 28, 2026
@Dipa-Sarker Dipa-Sarker added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 28, 2026
@Joshuafolorunsho Joshuafolorunsho added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 1, 2026
Comment on lines +8 to +21
// num stores the result of the expression after calculating it.
// Try breaking down the expression and using documentation to explain what it means
// It will help to think about the order in which expressions are evaluated
// Try logging the value of num and running the program several times to build an idea of what the program is doing
// There is a range of numbers from 1 to 100. In the expression,
// (maximum - minimum + 1) calculates the size of the possible integers, which is 100.
// The Math.random() function generates a random decimal number in the range 0 ≤ x < 1.
// This random decimal is then multiplied by the range size to scale it to a
// value between 0 and 100. The result is a floating-point number in this interval.
// Next, Math.floor() is used to round the number down to the largest integer less than
// or equal to the calculated value, producing an integer between 0 and 99.
// Finally, by adding minimum, the range is shifted from 0–99 to 1–100, giving a random
// integer within the required range.
// I have run 5 times the program and this produces different values each time because
// Math.random() generates a new random decimal number every time.
// Since the final value of num depends on this function, the result changes on each execution. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I really like how you have explained this.
Good job!

Comment thread Sprint-1/2-mandatory-errors/0.js Outdated
Comment on lines +3 to +5

// We can solve this problem by writing those two lines as comments using //,
// because JavaScript ignores commented lines and they will not be executed by the computer. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is correct, but doesn't quite solve the problem. If we were to run this file as it is, what will happen? Will the code compile?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think I made mistakes to write single line comment correctly. I made correction in the file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for looking at it again.

So I think you've got the objective of the section slightly wrong.
You obviously know what the problem is, as you have rightly explained.
However, the goal of the exercise is to apply that to the file.

i.e, Add the // to the start of each line.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh sorry! I think now I get the point and made the correction properly.

Comment thread Sprint-1/2-mandatory-errors/1.js Outdated
Comment on lines +5 to +6
// There is a constant variable age, which is fixed and it's value cannot be reassigned.
// If we want to change the value of age, we have to use let instead of const. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your explanation is correct, however If we were to run the code as it is, will the code compile successfully?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think I have made the same mistakes to write single line comment correctly. I made correction in the file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we apply the fix to the problem? By changing line 2 to reflect your explanation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Can you please explain this again? I cannot understand your question.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

At the moment, if you run this, it will error out because we are trying to update a constant variable age. You've rightly explained the problem, and that we should let. What I was asking is to effect the change by updating line 2 to use let.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh! now I got it and replace const with let. Also, I was confused about the rules of single line comment. That's why I put // at the end of each line. Now I made correction to all the files.

Comment thread Sprint-1/2-mandatory-errors/2.js Outdated
Comment on lines +7 to +8
// The variable const cityOfBirth = "Bolton"; needs to be declared at first.
// As it is not declared, JavaScript cannot find out the variable cityofBirth in console.log. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Another great explanation, however we need to actually fix the problem.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think I made same mistakes again to write single line comment correctly. I made correction in the file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we apply your explanation to this file?
I.e, move line 5 to maybe a different line?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I moved the line 5 (variable declaration line) before console.log and now I can see the output "I was born in Bolton".

Comment on lines 1 to +5
const cardNumber = 4533787178994213;
const last4Digits = cardNumber.slice(-4);
console.log(cardNumber.toString());
const cardNumber1 = cardNumber.toString()
const last4Digits = cardNumber1.slice(-4);
console.log(last4Digits);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Really clever solution, I really like it!
Do you think we can find a better variable name for cardNumber1?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I thought the variable name could be "newcardNumber" or "formatcardNumber". I used "formatcardNumber".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I thought the variable name could be "newCardNumber" or "formatCardNumber". I used "formatCardNumber".

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Much much better, well done!


// c) Using documentation, explain what the expression movieLength % 60 represents
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
// The expression movieLength % 60 devides the movieLength by 60 seconds and return the reminder

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A small typo here: devides

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry for the typo. I made correction.

// The variable result reprents the movieLength in hours:minutes:seconds. The variable should be renamed by totalDuration.

// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
// I have tried with 3 variables, 1515, 9999 & 70052. I observed that this code works succesfully with all the values

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Curious to see if a negative number will work.
What do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, negative numbers work. I tried with const movieLength = -1515; & it gives result 0:-25:-15 but this is not our requirment.

Comment thread Sprint-1/4-stretch-explore/chrome.md Outdated
invoke the function `alert` with an input string of `"Hello world!"`;

What effect does calling the `alert` function have?
// `alert` function deisplays a popup dialogue box with a message and the user have to click 'ok' button.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

one small typo here: deisplays

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

fixed typo.

Comment on lines +32 to +34
// There are 4 variable declarations lines.
// let carPrice = "10,000";
// let priceAfterOneYear = "8,543";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you please highlight the lines where the declarations are?
I.e line 1,10, 20.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

highlighted all 4 variable declaration lines.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Brilliant! You caught exactly what I wanted to see!
Previously, what you highlighted as variable reassignment weren't, but you have correctly identified them now. Very well done!

Comment on lines +28 to +29
// const priceDifference = carPrice - priceAfterOneYear;
// const percentageChange = (priceDifference / carPrice) * 100;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not quite. These lines are declarations, not reassignments. Have another look at what makes a statement a reassignment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Made corrections for variable reassignments.

@Dipa-Sarker Dipa-Sarker removed the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 5, 2026
@Joshuafolorunsho Joshuafolorunsho added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 6, 2026
Comment thread Sprint-1/2-mandatory-errors/2.js Outdated
@@ -1,5 +1,9 @@
// Currently trying to print the string "I was born in Bolton" but it isn't working...
// what's the error ?
// Currently trying to print the string "I was born in Bolton" but it isn't working... //

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I noticed you added // at the end? Do we need it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I explained in the previous comment and made correction.

Comment thread Sprint-1/2-mandatory-errors/2.js Outdated
// Currently trying to print the string "I was born in Bolton" but it isn't working...
// what's the error ?
// Currently trying to print the string "I was born in Bolton" but it isn't working... //
// what's the error ? //

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I noticed you added // at the end? Do we need it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

made correction.

Comment thread Sprint-1/2-mandatory-errors/2.js Outdated


// The variable const cityOfBirth = "Bolton"; needs to be declared at first. //
// As it is not declared, JavaScript cannot find out the variable cityofBirth in console.log. // No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I noticed you added // at the end? Do we need it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

made correction.

Comment thread Sprint-1/2-mandatory-errors/0.js Outdated
// This is just an instruction for the first activity - but it is just for human consumption //
// We don't want the computer to run these 2 lines - how can we solve this problem? //

// We can solve this problem by writing those two lines as comments using //

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I noticed you added // at the end? Do we need it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

made correction.

Comment thread Sprint-1/2-mandatory-errors/0.js Outdated
Comment on lines +1 to +2
// This is just an instruction for the first activity - but it is just for human consumption //
// We don't want the computer to run these 2 lines - how can we solve this problem? //

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I noticed you added // at the end? Do we need it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

made correction.

@Dipa-Sarker Dipa-Sarker removed the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 9, 2026
@Joshuafolorunsho Joshuafolorunsho added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 10, 2026

@Joshuafolorunsho Joshuafolorunsho left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well done!

@Joshuafolorunsho Joshuafolorunsho added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants