Skip to content

Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 2 | Structuring and Testing Data#1048

Open
mahmoudshaabo1984 wants to merge 2 commits intoCodeYourFuture:mainfrom
mahmoudshaabo1984:coursework/sprint-2
Open

Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 2 | Structuring and Testing Data#1048
mahmoudshaabo1984 wants to merge 2 commits intoCodeYourFuture:mainfrom
mahmoudshaabo1984:coursework/sprint-2

Conversation

@mahmoudshaabo1984
Copy link

@mahmoudshaabo1984 mahmoudshaabo1984 commented Feb 24, 2026

  • I have tested my changes
  • My changes follow the style guide
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task

Summary of work:

  • Completed all mandatory exercises for Sprint 2.
  • Fixed syntax and scope bugs in 1-key-errors and 2-mandatory-debug.
  • Implemented BMI calculator, toUpperSnakeCase, and toPounds functions in 3-mandatory-implement.
  • Traced and explained the time formatting code in 4-mandatory-interpret.

@mahmoudshaabo1984 mahmoudshaabo1984 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 24, 2026
@mahmoudshaabo1984
Copy link
Author

Hi team, 👋

Just a quick note to say that I have successfully completed all the mandatory tasks for Sprint 2.

This week was incredibly helpful and enjoyable! I really liked the transition from debugging and fixing scope/syntax errors to actually implementing my own functions from scratch (like the BMI calculator and String manipulation).

I made sure to document my code clearly, and I even added a few extra test cases of my own to ensure everything works perfectly under different conditions.

Looking forward to your feedback and any suggestions for improvement.

Thank you for your time and support!
Mahmoud

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.

Code looks good.

I just have some comments and a question (see the inline comments)

Comment on lines 6 to 8
const num = 103;
// We don't need this global variable, so I commented it out:
// const num = 103;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: Deleting the global num is optional. Within the function block, num is resolved to the parameter num.
If you are interested in the topic, you can looking up these two concepts, identifier scope and identifier resolution, in the context of JavaScript programming. ChatGPT can give a good explanation.

// return the BMI of someone based off their weight and height
} No newline at end of file
// 3. Return the result to 1 decimal place (إرجاع النتيجة بخانة عشرية واحدة)
return bmi.toFixed(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

What type of value do you expect your function to return? A number or a string?
Does your function return the type of value you expect?

Different types of values may appear identical in the console output, but they are represented and treated differently in the program. For example,

  console.log(123);              // Output 123
  console.log("123");            // Output 123
  
  // Treated differently in the program
  let sum1 = 123 + 100;         // Evaluate to 223 -- a number
  let sum 2 = "123" + 100;      // Evaluate to "123100" -- a string.

@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 Feb 26, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Feb 26, 2026

There were four self-check items in the PR template. In your PR description. There are only two. It is missing the following two items:

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task

@mahmoudshaabo1984
Copy link
Author

Hi CJ, thank you so much for the feedback and the clear explanations!

  1. For the PR template, I have updated the description and checked all the required boxes.
  2. For 2.js, I have completely deleted the global const num = 103 variable to keep the code clean.
  3. For 1-bmi.js, I realize now that .toFixed() returns a string! I have fixed this by wrapping the result in the Number() function so it returns a number type as expected.

I have pushed the updates. Thank you again for your time and support!

@cjyuan
Copy link
Contributor

cjyuan commented Feb 28, 2026

All changes look good. Well done!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 28, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Feb 28, 2026

You should also add a "Needs review" label too when the PR is ready to be re-reviewed. I have marked this PR as "Complete". You can practice that in future PRs. :)

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.

2 participants