Skip to content

London | Jan2026 | Ihor Taradaiko | Sprint 1 | Coursework/sprint 1#934

Open
ihortar wants to merge 13 commits intoCodeYourFuture:mainfrom
ihortar:coursework/sprint-1
Open

London | Jan2026 | Ihor Taradaiko | Sprint 1 | Coursework/sprint 1#934
ihortar wants to merge 13 commits intoCodeYourFuture:mainfrom
ihortar:coursework/sprint-1

Conversation

@ihortar
Copy link

@ihortar ihortar commented Feb 7, 2026

  • - 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 the following exercises:

Key Exercises
Mandatory Errors
Mandatory Interpret

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

This comment has been minimized.

6 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@ihortar ihortar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 7, 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 7, 2026
@ihortar ihortar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 7, 2026
@cjyuan cjyuan added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 16, 2026
Comment on lines 8 to +10
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
// Describe what line 3 is doing, in particular focus on what = is doing
//It takes the current value of count, add 1 to it 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.charAt()}${middleName.charAt()}${lastName.charAt()} `;
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally, we specify an argument in the function call .charAt() to indicate the position of the character to return. For example, firstName.charAt(0) to extract the first character.

Can you find out why the statement on line 8 can still work?

We don't recommend this practice. Can you update the code on line 8 to explicitly pass an argument to each function .charAt() to extract the first character?

// 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
//results: 4,23,91,46 the program is giving you a random number while math.random give you a random decimal number math.floor rounds the total number up 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.

Can 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 can use the concise and precise interval notation:

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

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

Comment on lines +6 to +7
const HourClockTime24 = "20:53";
const hourClockTime12 = "08:53";
Copy link
Contributor

Choose a reason for hiding this comment

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

In JS naming convention, variable names usually begins with a lowercase letter. Names starting with an uppercase letter are used for built-in and custom data types (e.g., Math)


// a) How many function calls are there in this file? Write down all the lines where a function call is made

//4,5,11
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 also indicate the total number of function calls? (It is not three).

Comment on lines 22 to +23
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?

//math expression
Copy link
Contributor

Choose a reason for hiding this comment

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

The question means to ask, "what does (movieLength - remainingSeconds) / 60 calculate?"

Comment on lines -24 to +25

//maybe timeLeft or similar
Copy link
Contributor

Choose a reason for hiding this comment

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

When I see a variable named timeLeft, I may think

  • It represents a remaining time.
  • Is looks like it is storing a number.
  • What is the unit of the time? Is it in hours or seconds?

Can you think of a more meaningful name that could more accurately describe the value it stores.

Comment on lines 15 to +18
const pence = paddedPenceNumberString
.substring(paddedPenceNumberString.length - 2)
.padEnd(2, "0");

//5. takes the last 2 digits as the pence from paddedPenceNumberString
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?

What is the return value of `prompt`?
//shows a pop-up to enter a name / stores and shows name
What effect does calling the `prompt` function have? //shows pop-up form
What is the return value of `prompt`? //if myName is set returns myName value
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 describe the return value of prompt() as I am someone who has never used the function before?

The current description does not quite tell me exactly what the function returns.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 16, 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