Skip to content

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

Open
Dipa-Sarker wants to merge 14 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 14 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
@Dipa-Sarker Dipa-Sarker changed the title London | 26-ITP-May | Dipa Sarker | Sprint 1 | Sprint 1 Coursework London | 26-ITP-May | Dipa Sarker | 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
@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 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?

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?

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.

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?


// 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

// 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?

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

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants