Skip to content

London | 26-ITP-Sep | Abakar Souleyman | Sprint 2 | Coursework - #1530

Open
abmhts wants to merge 25 commits into
CodeYourFuture:mainfrom
abmhts:coursework/sprint-2
Open

abmhts wants to merge 25 commits into
CodeYourFuture:mainfrom
abmhts:coursework/sprint-2

Conversation

@abmhts

@abmhts abmhts commented Sep 17, 2026

Copy link
Copy Markdown

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

Task code

CYF-1039

Changelist

Completed JavaScript fundamental tasks covering variables, assignment operators, strings, numbers, calculations, random numbers, time conversions, and objects. Also completed Chrome Console exercises.

@netlify

netlify Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit 9e45bc7
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6aaf13fa05de420009dec14a
😎 Deploy Preview https://deploy-preview-1530--cyf-onboarding-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
2 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@abmhts abmhts added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 17, 2026
Comment thread Sprint-2/1-key-exercises/2-initials.js Outdated
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.

const initials = ``;
const initials = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Add a semicolon at the end of this line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you, added a semicolon at the end.

Comment thread Sprint-2/1-key-exercises/4-random.js Outdated
//num represents a randomly generated whole number between 1 and 100.

// Try breaking down the expression and using documentation to explain what it means
// Math.random() generates a random decimal number greater than or equal to 0 and less than 1. Multiplying it by 100 gives a number between 0 and 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.

It gives us maximum 100 ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Gives a number between 0 and up to, but not including 100.
Thank you

Comment thread Sprint-2/1-key-exercises/4-random.js Outdated
// Math.random() generates a random decimal number greater than or equal to 0 and less than 1. Multiplying it by 100 gives a number between 0 and 100.
// Math.floor() always rounds down and returns the largest integer less than or equal to a given number in this case between 0 and 99. Finally, adding 1 changes the range to 1–100.
// Math.floor(Math.random() * (maximum - minimum + 1))
// Math.floor(Math.random() * (100 - 1 + 1)

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 closing bracket is missing in this line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added the missing closing bracket.
Thank you

const age = 33;
age = age + 1;

let age = 33;

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 file does not run, check age declaration

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Corrected. Thank you

Comment thread Sprint-2/2-mandatory-errors/3.js Outdated
@@ -1,9 +1,15 @@
const cardNumber = 4533787178994213;

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 file does not run. Check cardNumber and last4Digits declaration

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Corrected. Thank you!

Comment thread Sprint-2/2-mandatory-errors/4.js Outdated
@@ -1,2 +1,5 @@
const 12HourClockTime = "8:53pm";

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 file does not run. Check variable declaration

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Corrected. Thank you.

@abdishakoor-dev abdishakoor-dev 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.

Thanks for the quick turnaround, all six of the earlier comments are sorted.

Three files still stop with an error when you run them, and two of them stop for the same reason.

Before I can mark this Complete:

  1. 2-mandatory-errors/0.js, see my comment.

  2. 3-mandatory-interpret/1-percentage-change.js and 3-to-pounds.js both stop with an error. See my comment on each.

  3. 3-mandatory-interpret/1-percentage-change.js answer a), see my comment.

  4. 2-mandatory-errors/1.js and 4.js: the fixes are right, but this section also asks you to explain the error, and there is nothing written down for either. You did that well in 2.js and 3.js, so the same again.

  5. Could you run Prettier over the Sprint-2 folder? Most of the files are not formatted at the moment.

Add the Needs Review label again when you have pushed.

Comment thread Sprint-2/2-mandatory-errors/0.js Outdated
@@ -1,2 +1,5 @@
This is just an instruction for the first activity - but it is just for human consumption

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 have added the two lines as comments below, which is the right idea. But lines 1 and 2 are still here as they were, so node still reads them as JavaScript and stops. What needs to happen to these two lines?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Deleted the two lines.

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.

That is it, thanks.


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

4 function calls

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.

Your answers from here down are written as code rather than as comments, so node tries to run them and stops. Compare this file with 2-time-format.js, where you put // in front of every answer. That is the way to do it.

On a) itself: you have found four calls. Look at line 10 as well. What is console.log(...) doing there?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I missed that. I’ve corrected it to five calls. Thanks for pointing it out.

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.

Five is right, and console.log is the one people miss.

// To begin, we can start with
// 1. const penceString = "399p": initialises a string variable with the value "399p"

1. const penceString = "399p" // Stores "399p" in a variable called penceString so the program can work with the price.

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.

Same thing here. Your breakdown from this line down is written as code, so the file stops with an error. The content of the six steps is right, they just need to be comments.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Understood. I’ve corrected the six steps and converted them to comments.

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.

Good, the file runs now.

//const age = 33;
//age = age + 1;

let age = 33;

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 fix is right and the file runs now. This section also asks you to interpret the error and explain why it happened, and there is nothing written down here yet. What did node print before you changed it, and why?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I didn’t see the section asking me to explain the error, so perhaps I’m looking in the wrong place.
Node returned TypeError: Assignment to constant variable because const cannot be reassigned, so I used let instead. My apologies if I’ve misunderstood the task.

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 were not looking in the wrong place. This file does not ask for it anywhere, only the section heading in the Sprint-2 README does. No apology needed. Your explanation here is right, so that is done.

//const 12HourClockTime = "8:53pm";
//const 24hourClockTime = "20:53";

const ClockTime12Hour = "8:53pm";

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 renaming is right and the file runs. Same as 1.js though, there is no explanation of the error. What did node say before, and what was wrong with the original two names?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Node returned SyntaxError: Invalid or unexpected token. Both variable names started with a number, which JavaScript does not allow.
Again, I might be looking in the wrong place or have misunderstood the task.

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.

Same here, and your explanation is correct. Nothing else needed on this one.

@abdishakoor-dev abdishakoor-dev 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 Sep 19, 2026
@abmhts

abmhts commented Sep 19, 2026

Copy link
Copy Markdown
Author

I’ve run Prettier over the Sprint-2 folder and formatted the files. Thanks for letting me know about Prettier—I wasn’t familiar with it before.

@abmhts abmhts added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 19, 2026

@abdishakoor-dev abdishakoor-dev 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.

Everything is sorted. All twelve files run, the answers are all there, and Prettier is clean.

On the two files where you asked whether you were looking in the wrong place: you were not. Neither file asks for an explanation anywhere in it. It is only mentioned in the heading of section 2 in the Sprint-2 README, which is easy to miss. Both of your explanations are right, so that is fine.

Marking this Complete.

@abdishakoor-dev abdishakoor-dev added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants