Skip to content

London | 26-ITP-SEPT | Carol Nassuna | Sprint 3 | Coursework - #1606

Open
Mugs3 wants to merge 4 commits into
CodeYourFuture:mainfrom
Mugs3:coursework/Sprint-3
Open

Mugs3 wants to merge 4 commits into
CodeYourFuture:mainfrom
Mugs3:coursework/Sprint-3

Conversation

@Mugs3

@Mugs3 Mugs3 commented Sep 27, 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-1053

Changelist

02/09 - Updated files from the last run

30/09 - Corrected issues from run 1

I have updated all Sprint-3 files in the key errors, mandatory debug, mandatory implement and mandatory interpret folders

@netlify

netlify Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit ed4e7a2
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ac0bc4a6659fa0009c61c54
😎 Deploy Preview https://deploy-preview-1606--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.

@Mugs3 Mugs3 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 27, 2026
@hey-hammad hey-hammad 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 Sep 29, 2026
Comment thread Sprint-3/1-key-errors/0.js Outdated
console.log(capitalise("beautiful"));

// =============> write your explanation here
// function is assigned 2 arguments/values=============> write your explanation here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please review the error message again and update the explanation. Think about what the error message is about and why it needs to be fixed.

Comment thread Sprint-3/1-key-errors/1.js Outdated
console.log(decimalNumber);

// =============> write your explanation here
// decimalNumber has been declared as a function and a variable within function scope=============> write your explanation here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

decimalNumber is not a function.

Please review the explanation again and think about the following question and finally update the explanation.

  • how is a function declaration different than a variable?
  • what are function arguments and parameters?
  • can a function variable and parameter have the same name?

// Syntax errorError Unexpected number.=============> write the error message here

// =============> explain this error message here
// Means Function identifier should be a name not a number =============> explain this error message here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Whats the difference between function identifier and parameter?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think you're confused between the function identifiers, parameters and arguments.

please review the following and update the explanation.

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's right now, and the fix on line 23 too. Well done for sticking with this one.


// =============> write your explanation here

//The 2nd console log returned value value is undefined. I have added a return function to output the multiply value.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why was the value returned by the function is undefined?

Comment thread Sprint-3/2-mandatory-debug/1.js Outdated
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

// =============> write your explanation here
// Maybe that unassigned return; may cause the code not to run fully =============> write your explanation here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When you don't understand how or why a particular part of the code works or behaves in a certain way, it's best to dig a little deeper so you can build a solid understanding of it.

Please review the following MDN documentation on the return statement to help you understand how function returns work:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return

// return the BMI of someone based off their weight and height
}

function calculateBMI(weight, height) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

pleaser review the formula for calculating the BMI in the description above again.

// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase

function toUpperSnakeCase(text) {
return text.trim().replace(/\s+/g, "_").toUpperCase();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is there a need to use trim and regex pattern here? is there an easy of achieving this without using them?

console.log(`£${pounds}.${pence}`);*/

// Revised code:
function poundsToPence(penceString) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

function name is a bit misleading.


// c) What is the return value of pad when it is called for the first time?
// =============> write your answer here
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.

please review the answer again.

@hey-hammad hey-hammad 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 Sep 29, 2026
@Mugs3 Mugs3 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 30, 2026
@hey-hammad hey-hammad 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 Oct 2, 2026
// Syntax errorError Unexpected number.=============> write the error message here

// =============> explain this error message here
// Means Function identifier should be a name not a number =============> explain this error message here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think you're confused between the function identifiers, parameters and arguments.

please review the following and update the explanation.

Comment thread Sprint-3/3-mandatory-implement/1-bmi.js Outdated

function calculateBMI(weight, height) {
// return (weight / height).toFixed(1); - 1st attempt
return (weight / (height * height)).toString().slice(0, 4);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

thats the correct formula now, however do you need to use .toString() and .slice() for getting fixed decimal points? is there an easier way of doing it without converting the value to string?

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.

Nearly there, toFixed(1) is the right tool. Run the file and you'll see both lines print ${(weight / (height * height)).toFixed(1)} as plain text. That's because ${} only works inside backticks (`), not double quotes.

You don't need ${} here at all, because toFixed(1) already gives back a string. What happens if you remove the quotes and the ${ } and return the calculation on its own?

console.log(text);

// Trim and regex pattern was the only saving grace I came across to resolve the underscore issue I had spent hours researching.
// I have however now modified and replaced the pattern for easy understanding with AI's help

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I appreciate your transparency. Using AI as a tool for research and to help clarify concepts you're struggling with is absolutely fine. You can find further guidance on the appropriate use of AI in the document below.

https://docs.google.com/document/d/1Rq3dh3yE7sqkBM1cTPP6-f2CSO4lhdhi_2yXxAV3EfA/edit?tab=t.0#heading=h.3kept1c7ccss

@hey-hammad hey-hammad 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 Oct 2, 2026
@Mugs3 Mugs3 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 Oct 3, 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.

Good progress: 1-key-errors/2.js is right now, and line 15 explains the parameter clearly. You're close on the rest. Four things left, and each one is a small change:

  1. 1-key-errors/0.js and 1.js: put the original code in comments so your new code can run. See my comment on 0.js line 19.
  2. 1-key-errors/1.js line 32: log the result of calling your function.
  3. 1-bmi.js: the quotes on line 24 (see my reply in the earlier thread), and the height on line 27.
  4. time-format.js line 43: one word to fix in the explanation for e).

Add the Needs Review label again once you've pushed.

// =============> write your explanation here
// =============> write your new code here

function capitalise(str) {

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 new code here is right, but it never runs. Try it: right click the 1-key-errors folder in VS Code, choose Open in Integrated Terminal, and run node 0.js. You'll see the SyntaxError from line 8. The original code on lines 7 to 11 still runs first, and JavaScript stops at the first error.

Select lines 7 to 11 and press Ctrl + / (Cmd + / on a Mac) to turn them into comments. Run node 0.js again and you should see Beautiful.

Do the same in 1.js for lines 9 to 16.

}
const decimalNumber = 0.5;

console.log(decimalNumber);

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.

After you comment out the original code, this line prints 0.5. That's the number going in, not the answer. The function's job is to turn 0.5 into 50%, so log what the function gives back: console.log(convertToPercentage(...)), with your number inside the brackets. You should see 50%.

return "${(weight / (height * height)).toFixed(1)}";
}

console.log(`the bmi of 70 and 2.99 is ${calculateBMI(70, 2.99)}`);

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 function needs the height, not the height squared. Line 7 shows the person is 1.73 m tall; 2.99 is what you get after squaring it. Your function already does the squaring on line 24, so pass 1.73. calculateBMI(70, 1.73) should print 23.4, the same as line 9. Checking against the example you were given is a good habit.


// e) What is the return value of pad when it is called for the last time in this program? Explain your answer
// =============> write your answer here
// The answer is 01 because of the final output for formatTimeDisplay(61) is 00:01:01. The assigned value of 1 with the length of 1, the numString = "0" + numString becomes 1

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 answer 01 is right, only the last word needs fixing. On the last call numString is "1", which has length 1, so the loop runs once and "0" + "1" gives "01". So numString becomes "01", not 1.

@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 Oct 4, 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.

3 participants