Skip to content

Cape Town | 2026-ITP-Jan | Pretty Taruvinga | Sprint 2 | Structuring And Testing Data #1007

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

Cape Town | 2026-ITP-Jan | Pretty Taruvinga | Sprint 2 | Structuring And Testing Data #1007
Pretty548 wants to merge 8 commits intoCodeYourFuture:mainfrom
Pretty548:coursework/sprint-2

Conversation

@Pretty548
Copy link

@Pretty548 Pretty548 commented Feb 21, 2026

Learners, PR Template

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

Changelist

In this sprint I worked on JavaScript challenges focused on functions, arrays, and string manipulation. I wrote pure functions that return values so they can be tested and used unit tests to confirm my solutions work correctly.

I practiced key concepts like variable scope, avoiding variable shadowing, and using methods such as padStart for formatting. One issue I faced was redeclaring a variable inside a function, which I fixed by using the parameter instead.

This sprint improved my problem-solving skills and my confidence in debugging and writing cleaner, more readable code.

@github-actions

This comment has been minimized.

4 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Pretty548 Pretty548 added 🏕 Priority Mandatory This work is expected 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Feb 21, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 21, 2026
@Pretty548 Pretty548 changed the title Cape Town | 2026-ITP-Jan | Pretty Taruvinga | Sprint 2 | Structuring And Testing Data | Cape Town | 2026-ITP-Jan | Pretty Taruvinga | Sprint 2 | Structuring And Testing Data Feb 21, 2026
@Pretty548 Pretty548 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 21, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Mar 2, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good work, just one function you could improve a bit further

function calculateBMI(weight, height) {
// return the BMI of someone based off their weight and height
const bmi = weight / (height * height);
return Math.round(bmi * 10) / 10;

Choose a reason for hiding this comment

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

Why do you multiply by 10 and then divide by 10? Is there an easier way to get 1 decimal place?

Copy link
Author

Choose a reason for hiding this comment

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

I multiplied by 10 and divided by 10 to round the BMI to one decimal place using Math.round(), since it only rounds whole numbers.
Alternatively, I could use Number(bmi.toFixed(1)) which is a bit cleaner and more readable.

Choose a reason for hiding this comment

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

Good suggestion - I think toFixed makes more sense here. Can you make that change in the code?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I've updated the function to use toFixed(1) for rounding to one decimal place.

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 2, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good work!

@LonMcGregor LonMcGregor 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 Mar 4, 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. Module-Structuring-And-Testing-Data The name of the module. 🏕 Priority Mandatory This work is expected 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants