Skip to content

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

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

gaireprakash20-ops wants to merge 33 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 bbf3eaf
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ac02408e1666e00089f4475
😎 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 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 1, 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. I can see you changed the quotes on line 18 of 2-cases.js. But I think you changed them by hand. Prettier did not run.

How can I tell? Prettier changes every place in the file, not one line. It would also change these:

  • Line 17: str){ would become str) {, with a space.
  • Line 20: 'hello there' would get double quotes too.

The same eight files still fail Prettier.

Please do not format the code by hand. Prettier must do it.

When you choose Format Document, does VS Code show a message? If you see a button called Configure..., click it, and choose Prettier - Code formatter. Then choose Format Document again.

If this does not work, please ask a volunteer at your next class to help you. Prettier is not working in your VS Code yet, and it is quicker to fix with someone next to you.

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 Oct 1, 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.

i did as per your instruction also configurate

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

formating

@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 trying again. Your new commit changes the quotes on line 20 of 2-cases.js by hand, but Prettier still did not run. Line 17 still has str){ with no space, and it now has two extra spaces at the end of the line. The same eight files still fail Prettier.

This is the fifth time I have explained Prettier in this PR, and the written steps are not working. This could be a setup problem in your VS Code, and it is much quicker to fix with someone next to you than in PR comments.

Please get help in person:

  • Book time with a volunteer,
  • Ask a fellow trainee who has Prettier working, or
  • Bring your laptop to the Saturday study group session and ask for help with Prettier.

Show them this PR. Together, check that Prettier is installed, run Format Document on each file you changed, and turn on format on save so it happens every time from now on.

Your answers are all correct, so once Prettier has run on your files, commit, push and add the Needs Review label again. I'll mark this Complete then.

@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 2, 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.

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 Oct 2, 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.

Prettier is working in your VS Code now, and you ran it on every file. Well done for sticking with it. Your answers were already correct, so I'm marking this Complete.

One thing for next time. Your Prettier is set to use tabs and single quotes '. Prettier's default, which the other CYF repos use, is spaces and double quotes ". Some repos, like the TV Show project, don't set this for you. So before your next PR:

  1. In VS Code, open Settings (Cmd+, on Mac or Ctrl+, on Windows).
  2. Search for prettier single quote, and untick it.
  3. Search for prettier use tabs, and untick it.

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 Oct 3, 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. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants