Skip to content

London | 26-ITP-Jan | Gloria Mankrado | Sprint 1 |Sprint-1#1108

Open
gloriamanks wants to merge 3 commits intoCodeYourFuture:mainfrom
gloriamanks:coursework/sprint-1
Open

London | 26-ITP-Jan | Gloria Mankrado | Sprint 1 |Sprint-1#1108
gloriamanks wants to merge 3 commits intoCodeYourFuture:mainfrom
gloriamanks:coursework/sprint-1

Conversation

@gloriamanks
Copy link

@gloriamanks gloriamanks commented Feb 28, 2026

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

excerise 1
updated exercise 1 to include comment
updated excerise 2 to extract the zero based index of each variable names
updated excerise 3 to find the pathway directory and also the file after the forward slash
updated excerise 4 to extract the environment variable of num using $

excerise 2 & 3
converted a pence string into a pounds-and-pence
formatted output, then added detailed comments to explain each calculation step.
This program takes a string representing a price in pence
The program then builds up a string representing a price in pounds

@github-actions

This comment has been minimized.

@gloriamanks gloriamanks changed the title London | 26-ITP-Jan | Gloria Mankrado | Sprint 3 | Implement and Rewrite Tests London | 26-ITP-Jan | Gloria Mankrado | Sprint 1 |Sprint-1 Feb 28, 2026
@gloriamanks gloriamanks added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 2, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

I noticed some inconsistency in the formatting of the code.

Consider install prettier VSCode extension and enable formatting on save/paste on VSCode as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md

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

// Line 3 is updating the value of the count variable. The = operator is an assignment operator, which assigns the value on the right (count + 1) to the variable on the left (count). In this case, it takes the current value of count (which is 0), adds 1 to it, and then assigns the result (1) back to count. So after this line executes, count will have a new value of 1. 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?

Comment on lines +10 to +11

console.log(`num is ${num}`);
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.

Copy link
Contributor

Choose a reason for hiding this comment

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

You fixed the error.

You were supposed to also answer questions (a)-(e) in this file.

Any way, for question (b), the error occurred because a comma was missing between the ___________s.
What is the programming term that belongs in the blank?

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 answer questions (a)-(f) in this file?

Comment on lines +22 to 25
// 5. extract the last two characters as the pence amount and pad right with a zero if needed
const pence = paddedPenceNumberString
.substring(paddedPenceNumberString.length - 2)
.padEnd(2, "0");
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional challenge:
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 Mar 5, 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