Skip to content

London | 26-ITP-Jan | Boualem Larbi Djebbour | sprint 2 | Coursework#1123

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

London | 26-ITP-Jan | Boualem Larbi Djebbour | sprint 2 | Coursework#1123
djebsoft wants to merge 24 commits intoCodeYourFuture:mainfrom
djebsoft:coursework/sprint-2

Conversation

@djebsoft
Copy link

@djebsoft djebsoft commented Mar 1, 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

complete sprint 2 mandatory tasks

Questions

Corrected variable declaration issue and updated function to return the capitalized string.
…ge function

Removed duplicate declaration of decimalNumber and updated the function to correctly convert a decimal to a percentage.
Corrected the square function to accept a parameter and return its square.
Refactor multiply function to return result and log output.
Corrected the sum function to return the sum of two numbers.
Corrected the getLastDigit function to accept a parameter and return the last digit of the given number.
Corrected the function getLastDigit to properly accept a parameter.
Added explanations and answers to questions regarding the pad function in time-format.js.
Implemented the toPounds function to convert pence to pounds.
Added a function to convert a string to upper snake case.
@djebsoft djebsoft added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 1, 2026
Comment on lines +23 to +27
function multiply(a, b) {
return console.log(
`The result of multiplying ` + a + ` and ` + b + ` is ` + a * b
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is a need to output the string in a fixed format from different "places" in the program, it would make sense to implement a function do so.

However, what is the purpose of returning the return value of console.log()? What value do you expect console.log() to return?

function calculateBMI(weight, height) {
// return the BMI of someone based off their weight and height
} No newline at end of file
return (BMI = (weight / (height * height)).toFixed(1)); // return the BMI of someone based off their weight and height
Copy link
Contributor

Choose a reason for hiding this comment

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

  • What is BMI? Why not just return the value of the expression (weight / (height * height)).toFixed(1)?

  • 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.

Comment on lines +17 to +21
function upperSnakeCase(wordsSet) {
let wsSnakeCase = wordsSet.replaceAll(" ", "_");
let wsupperSnakeCase = wsSnakeCase.toUpperCase();
return console.log(wsupperSnakeCase);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Accordingly to the description on lines 9-10, the function is expected to return the converted value, not output the converted value to the console.

@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 Mar 11, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants