Skip to content

London | 26-ITP-May | Anita Amirhaeri | Sprint 1 | Structuring-and-Testing-Data - #1566

Open
anitahy73 wants to merge 8 commits into
CodeYourFuture:mainfrom
anitahy73:coursework/sprint-1
Open

London | 26-ITP-May | Anita Amirhaeri | Sprint 1 | Structuring-and-Testing-Data#1566
anitahy73 wants to merge 8 commits into
CodeYourFuture:mainfrom
anitahy73:coursework/sprint-1

Conversation

@anitahy73

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

Sprint 1 tasks

Questions

Added a comment explaining the increment operation on the count variable.
Updated the initials variable to dynamically extract the first characters from firstName, middleName, and lastName.
Log the randomly generated number to the console.
Added comments to provide instructions for the first activity.
Added comments to explain variable declarations and expressions.
Added comments to explain variable usage and code functionality.
Added comments explaining the purpose of each step in the code.
@anitahy73 anitahy73 added 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Jul 26, 2026
@cjyuan cjyuan added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 27, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You missed updating 4 files in Sprint-1/2-mandatory-errors.

Comment on lines +5 to 9
console.log (num);
// In this exercise, you will need to work out what num represents?
// 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you give a precise description what each of these expressions does, and the range of the numbers it may produce?

  1. Math.random()
  2. Math.random() * (maximum - minimum + 1)
  3. Math.floor(Math.random() * (maximum - minimum + 1))
  4. Math.floor(Math.random() * (maximum - minimum + 1)) + minimum

Note: To describe a range of numbers, we could use the concise and precise interval notation:

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

For example, $x$ is a number in $[1, 10)$ means:

$x$ is a number between 1 and 10, including 1 but excluding 10.

a) There are 5 calls made:
carPrice = Number(carPrice.replaceAll(",", ""));
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""))
b) Error on line 5 for "," it is missing the seperating , between "," and "".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also say, "a comma is omitted between the ___________s."

What is the programming term that refers to the values (e.g., "," and "") passed to a function? It begins with an 'a'.

c) It is taking the movieLength and doing a remainder that is showing what is left after the vaule has been divided, in this case wil be 84.
I found the info here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder
d) It is removing any extra seconds from the division by 60 so that is is showing as whole numbers without decimals.
e) Result is showing the movies duration but broken down to hours:minutes:seconds, I think it should be movieDuration to help describe it better.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The name movieDuration does not quite indicate the value stored in the variable
is a formatted string in the form "2:12:02".

Could you suggest a more descriptive name?

@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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants