Skip to content

London | 26-ITP-Jan | Zadri Abdule | Sprint 2 | Coursework#966

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

London | 26-ITP-Jan | Zadri Abdule | Sprint 2 | Coursework#966
Zadri415 wants to merge 15 commits intoCodeYourFuture:mainfrom
Zadri415:coursework/sprint-2

Conversation

@Zadri415
Copy link

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

Completed all of the tasks for Sprint 2.

@Zadri415 Zadri415 added 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. 📅 Sprint 2 Assigned during Sprint 2 of this module labels Feb 13, 2026
// The "Unexpected number"
// Finally, correct the code to fix the problem

// The "Unexpected number" error arises when a number is improperly positioned or used within JvaScript code

Choose a reason for hiding this comment

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

Always double-check to avoid typos in the comments that could lead to confusion (small detail that means a lot)

}

console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}

Choose a reason for hiding this comment

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

Is this line of code complete?

console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

// =============> write your explanation here
// The problem was the semicolon after return, which made the function stop before adding the numbers

Choose a reason for hiding this comment

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

Could you review the code you have written below as the solution and the previous code to understand why the previous function (before your solution) raised an error and update the explanation?

const penceStringWithoutTrailingP = penceString.substring(0, penceString.length -1);
const pounds = paddedPenceNumberString.slice(0, -2);
const pence = paddedPenceNumberString.slice(-2);
return `£${pounds}.${pence}`;

Choose a reason for hiding this comment

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

Check on the indentation here


// You should call this function a number of times to check it works for different inputs
function formatPenceToPounds(penceString){
const penceStringWithoutTrailingP = penceString.substring(0, penceString.length -1);

Choose a reason for hiding this comment

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

Is this variable in use when the function is called (or at all)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants