Skip to content

London | ITP-may-2026 | Hugh Mills | Sprint 2 | Sprint 2 Coursework - #1515

Open
HM-127BTY wants to merge 13 commits into
CodeYourFuture:mainfrom
HM-127BTY:acoursework/sprint-2`
Open

London | ITP-may-2026 | Hugh Mills | Sprint 2 | Sprint 2 Coursework#1515
HM-127BTY wants to merge 13 commits into
CodeYourFuture:mainfrom
HM-127BTY:acoursework/sprint-2`

Conversation

@HM-127BTY

Copy link
Copy Markdown

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

Completed the questions asked and added in code required for each task.

HM-127BTY added 10 commits July 9, 2026 18:03
Added answers to questions.
Added answers to the questions
Added answers to the questions.
added answer to questions asked.
Added answers to the questions asked.
Added code for the bmi calculator,
Completed the code required for the task.
Added the simple code for converting to pounds,  using kilograms.
@HM-127BTY HM-127BTY added 📅 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. labels Jul 15, 2026
Comment on lines +29 to +36
function convertToPercentage(decimalNumber) {
const decimal = 0.5;
const percentage = `${decimal * 100}%`;

return percentage;

}
console.log(convertToPercentage)

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.

How would you make the function to work for any valid argument?

For example, calling convertToPercentage(0.1) would return "10%".

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.

Like this?

function convertToPercentage(decimalNumber) {
return percentage = ${decimalNumber * 100}%;

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.

Comment on lines +18 to +22
function UpperSnake(text) {
let upperCase = text.toUpperCase();
let snakeCase = upperCase.replaceAll(" ","_");
return snakeCase;
}

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.

Code is correct.

Can you look up the naming conventions in JavaScript? In particular,

  • Variable and function names

Then, update the function names according to those conventions.

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.

Not to sure what you mean with this one?

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.

What's best practice to name a function in JavaScript?

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.

The name should describe clearly what the function is doing.

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.

so I should have named it more like upperCase => makeUpperCase and snakeCase => makeSnakeCase ?

@cjyuan cjyuan Aug 7, 2026

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.

Yes. A to prefix also works.

Comment on lines +7 to +9
function toPounds(weight) {
return (weight * 2.204);
}

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.

You are supposed to use the code in Sprint-1/3-mandatory-interpret/3-to-pounds.js to implement this function.

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 see my mistake there, I did fix the error and copy the code in and done the adjustments.

Comment on lines +28 to +32
// b) What is the value assigned to num when pad is called for the first time?
// =============> write your answer here
// =============> 61

// c) What is the return value of pad is called for the first time?
// =============> write your answer here
// =============> "61"

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.

When pad() is called the first time, its parameter num is not 61.

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 see now, i put in the value not what it became when num was called making it 0 for the first and 00 for the return.


// 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
// =============> 1 at const remainingSexonds = seconds % 60 gives 1 No newline at end of file

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.

What does pad() return when its parameter num is 1?

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 see my error, it should be 01

@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 Jul 19, 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. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants