Skip to content

Birmingham | ITP-Jan-26 | Ayodeji Ayorinde | Sprint 1 | Structuring and Testing Data#1128

Open
Ayogit1 wants to merge 2 commits intoCodeYourFuture:mainfrom
Ayogit1:main
Open

Birmingham | ITP-Jan-26 | Ayodeji Ayorinde | Sprint 1 | Structuring and Testing Data#1128
Ayogit1 wants to merge 2 commits intoCodeYourFuture:mainfrom
Ayogit1:main

Conversation

@Ayogit1
Copy link

@Ayogit1 Ayogit1 commented Mar 2, 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

My PR addresses all the exercises in Sprint 1

@Ayogit1 Ayogit1 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 minor inconsistency formatting in the code/comments.

Have you installed prettier VSCode extension and enabled formatting on save/paste on VSCode as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md


You missed the exercise in Sprint-1/1-key-exercises/4-random.js.


// 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 adding 1 to the initial values of count which is 0 and reassing the new value (1+0 =1) to count
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 = ``;
initials = firstName.substring(0, 1) + middleName.substring(0, 1) + lastName.substring(0, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

There are easier and more efficient ways to to extract a character at specific position/index in a string than using .substring().

Can you find out what they are and update your code accordingly?

Comment on lines +20 to +21
const dir = filePath.substring(0, 44);
console.log(`The dir part of the filePath variable is ${dir}`);
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 make these statements to work for any valid path? For example, they could still work correctly if we changed line 12 to

const filePath = "/Users/jacknguyen448/cyf/Module-2/Sprint-1/package.json";

Comment on lines +9 to +11
// Solution:
let age = 33;
let age = age + 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.

The solution is not quite correct. Have you tried running these two lines of code?

Comment on lines +16 to +17
const cardNumber = "4533787178994213";
const last4Digits = cardNumber.slice(-4);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suppose you were not allowed to modify the statement const cardNumber = 4533787178994213;
(that is, keep the variable's value unchanged).
How would you modify the code (through type conversion) so that you can still use .slice(-4) to extract the last 4 digits from the given number.

Comment on lines +10 to +11
const ClockTime12Hour = "20:53";
const ClockTime24hour = "08:53"; 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.

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)

Comment on lines +16 to +17
// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?

//ANSWER: The comma in the replaceAll() function in Line 5 is missing. Put the comma back in to fix it.
Copy link
Contributor

Choose a reason for hiding this comment

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

We can more precisely describe "A comma is missing between "," and "" in the function call" as:
A comma is missing between the ___________s.

What is the programming term that belongs in the blank?

Comment on lines +23 to +24
// e) What do you think the variable result represents? Can you think of a better name for this variable?

//ANSWER: The variable result represents the total lenth of the movie which shows the total hours, minutes and seconds remain in string format.
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 the second question in Part (e)?

Comment on lines 14 to 16
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 question (no change required):

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

Comment on lines +24 to +25
## promt: ƒ prompt() { [native code] }
## myName: Ayo
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the function return when a user clicks "Cancel" instead of "OK"?

@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