Skip to content

London | 26-ITP-Sep | Chandramani Gaire | Sprint 3 | Sprint 3 coursework - #1607

Open
gaireprakash20-ops wants to merge 19 commits into
CodeYourFuture:mainfrom
gaireprakash20-ops:Sprint-3
Open

gaireprakash20-ops wants to merge 19 commits into
CodeYourFuture:mainfrom
gaireprakash20-ops:Sprint-3

Conversation

@gaireprakash20-ops

@gaireprakash20-ops gaireprakash20-ops 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

I am solving some functional problems related to JavaScript.

@netlify

netlify Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

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

@gaireprakash20-ops gaireprakash20-ops left a comment

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 do as per the instruction

@gaireprakash20-ops gaireprakash20-ops added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 27, 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.

Your time-format.js answers are all correct, and d) and e) explain why.

Six things before I can mark this Complete:

  1. 1-bmi.js: see my comment on line 23.

  2. 1-key-errors/1.js: see my comment on line 18.

  3. 2-cases.js: see my comment on line 17.

  4. 3-to-pounds.js: see my comment on line 7.

  5. 2-mandatory-debug/2.js: see my comment on line 29.

  6. Eight of your files fail Prettier. "My code is consistently formatted" is part of the style guide in your PR checklist. Prettier is the tool that does it for you. It formats your code to one agreed style, so a reviewer only sees the changes you meant to make.

    Prettier comes with the CYF extension pack from onboarding. If you're not sure you have it, search for CodeYourFuture Extension Pack in VS Code Extensions: https://marketplace.visualstudio.com/items?itemName=CodeYourFuture.cyf-extension-pack

    Then open each file you changed, right click, choose Format Document, and pick Prettier if VS Code asks. To format every time you save, follow the steps here: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

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

Comment thread Sprint-3/3-mandatory-implement/1-bmi.js Outdated
const bmi = weight/squared_height;
return bmi.toFixed(1);
}
console.log(`The BMi of the person 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 is correct. The call on this line is not.

  • Line 5: the person is 1.73m tall.
  • Line 7: 2.99 is 1.73 x 1.73. So 2.99 is the height squared, not the height.
  • Your function already squares the height on line 19.

So when you pass 2.99, it is squared twice. That is why you get 7.8.

Please pass the height, 1.73, instead of 2.99. Line 9 says the answer should then be 23.4. Update your comment on line 24 too.

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 put the value 1.73 instead of 2.99 and update the comment on line24.

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.

Fixed now. 23.4 is right. Good.

Comment thread Sprint-3/1-key-errors/1.js Outdated

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

// while running this function is shows typeerror because decimal number variable is declared two times.

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 fixed code is correct. Only the error name on this line is wrong.

Line 18 says TypeError. But the original code gives a SyntaxError. The name decimalNumber is declared two times, and JavaScript does not allow that.

Please change "typeerror" on line 18 to "SyntaxError".

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 make a small correction type error into syntax error.

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 the one. Good.

// You will need to come up with an appropriate name for the function
// Use the MDN string documentation to help you find a solution
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
function touppercase(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 function works. It gives HELLO_THERE. Only the name needs to change.

The name should say what the function does:

  • touppercase says: make the letters capital. That is only half of the job.
  • Your function also changes spaces to _. Line 4 calls this UPPER_SNAKE_CASE.
  • So a better name is toUpperSnakeCase.

Also, in JavaScript we write a name with more than one word like this: the first word is small, and each new word starts with a capital letter. For example, toUpperCase, not touppercase. This is called camelCase.

Please rename the function, and the call on line 20.

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.

change the function name from touppercase into toUpperSnakeCase.

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.

toUpperSnakeCase is the one. Good.

// You will need to declare a function called toPounds with an appropriately named parameter.

// You should call this function a number of times to check it works for different inputs
function toPound(penceString) {

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.

Line 4 asks for a function called toPounds, with an s at the end. Your function is toPound, with no s. Please rename it, and the calls on lines 22 and 23.

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.

as per the instruction i changed the function name topounds from topound.

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.

Fixed now. Good.

Comment thread Sprint-3/2-mandatory-debug/2.js Outdated
// In this variable num is constant and there is no any declaration in function name. Due to this reasons result always be 3.
// Finally, correct the code to fix the problem
// =============> write your new code here
const num = 103;

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 on line 31 has its own num parameter. So is the num on line 29 used? If not, please remove it.

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 comment the line 29 but does not removed it. for reading its should be easy

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 original code on line 9 already shows const num = 103; for reading. Line 29 is part of your new code, and your new code does not need it at all.

The CYF style guide, which you ticked in your PR checklist, says:

Once you have solved the problem, you should remove large sections of commented out code. When you (or someone else) are reading your code, you want to know only the important pieces.

https://curriculum.codeyourfuture.io/guides/reviewing/style-guide/

Please delete line 29.

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.

Fixed now. Good.

@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 29, 2026
@gaireprakash20-ops gaireprakash20-ops 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 29, 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.

Thanks for the fixes. The BMI call, the SyntaxError answer and both function names are all right now.

Two things before I can mark this Complete:

  1. 2-mandatory-debug/2.js line 29: see my reply there.

  2. Eight of your files still fail Prettier, the same as last time. Please do these steps for each file you changed:

    • Open the file in VS Code.
    • Right click in the file, and choose Format Document.
    • If VS Code asks which formatter to use, choose Prettier.
    • Save the file.

    If you don't see Prettier, install the CodeYourFuture Extension Pack first: https://marketplace.visualstudio.com/items?itemName=CodeYourFuture.cyf-extension-pack

    To have Prettier do this every time you save, follow the format on save steps here: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

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

@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 30, 2026

@gaireprakash20-ops gaireprakash20-ops left a comment

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.

Remove the line 29 and formatted Prettier.

@gaireprakash20-ops gaireprakash20-ops 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

@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. Line 29 is gone now. Good.

One thing is left before I can mark this Complete. The same eight files still fail Prettier. Your last commit only changed 2-mandatory-debug/2.js. So the formatting did not reach GitHub.

Please try this with one file first, 2-cases.js:

  1. Open it in VS Code.
  2. Right click in the file, and choose Format Document.
  3. On line 18, the single quotes ' ' and '_' should change to double quotes. If nothing changes, Prettier is not running. Install the CodeYourFuture Extension Pack: https://marketplace.visualstudio.com/items?itemName=CodeYourFuture.cyf-extension-pack
  4. Save the file. It now shows in Source Control with an M.

Then do the same for the other seven files. Commit and push.

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

@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 30, 2026

@gaireprakash20-ops gaireprakash20-ops left a comment

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.

last of change and Prettier file Formatting

@gaireprakash20-ops gaireprakash20-ops 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants