Skip to content

Sheffield| 26-ITP-Jan| Mona-Eltantawy | Sprint 2 | Coursework/sprint 2#1227

Open
Mona-Eltantawy wants to merge 13 commits intoCodeYourFuture:mainfrom
Mona-Eltantawy:coursework/sprint--2
Open

Sheffield| 26-ITP-Jan| Mona-Eltantawy | Sprint 2 | Coursework/sprint 2#1227
Mona-Eltantawy wants to merge 13 commits intoCodeYourFuture:mainfrom
Mona-Eltantawy:coursework/sprint--2

Conversation

@Mona-Eltantawy
Copy link

@Mona-Eltantawy Mona-Eltantawy commented Mar 8, 2026

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

I did the required changes for the Sprint 2 key -errors, mandatory-debug, mandatory- implement and mandatory- interpret files. committed the changes and pushed it to the git branch.

…syntax error occurs when the program runs and write the new code that doesn't redeclare the decimalNumber in a const variable in inside the function
…e the function paramater name is unvaild number . and changed the code after trying it by changing the function name to num be decalred and to work when I call the function.
… return a value and changed the console.log inside the function into return instead.
…return statement comes befor the value a +b and changed it to the correct order.
…amater to the getLastDigit function to make it accept new paramaters when it's called.
…underscores using the .toUpperCase() and 'replace' functions.
…ing and added a return at the end of the function.
…n of the str identifier and this what happened when i tested the programe. I suggested to change the let variable name into an new name 'newStr' and this fixed the issue.
@Mona-Eltantawy Mona-Eltantawy added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 8, 2026
@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 Mar 8, 2026
@github-actions

This comment has been minimized.

@Mona-Eltantawy Mona-Eltantawy added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 8, 2026
// =============> write your explanation here
// =============> write your explanation here
when the program run it give a SyntaxError: Identifier 'decimalNumber' has already been declared. This is because the variable decimalNumber is declared twice in the function
convertToPercentage, and inside the function with the constant varible it redeclared again also using the function name decimalNumber with the console.log function will give an error because the function name should be
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence is quite long, and without punctuation marks it is not easy to read. Can you revise it?

when the program run it give a SyntaxError: Identifier 'decimalNumber' has already been declared. This is because the variable decimalNumber is declared twice in the function
convertToPercentage, and inside the function with the constant varible it redeclared again also using the function name decimalNumber with the console.log function will give an error because the function name should be
to fix this error we can remove the const variable declaration of decimalNumber from the function and use the function name
'ConvertToPercentage' to recall the function and pass the value of the decimalNumber.CSSStyleDeclaration
Copy link
Contributor

Choose a reason for hiding this comment

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

.CSSStyleDeclaration: What is this?

Comment on lines +21 to +22
while the ouout the out put for the console.log function out of the function returned the string provided in the function and an undefiened because the function multibly doesn't return any value.
to fix this error we need to change the console.log function inside the multiply function to return.
Copy link
Contributor

Choose a reason for hiding this comment

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

You have probably figured out the bug, but I can't quite get what this sentence mean.


function calculateBMI(weight, height) {
let BMI = weight / (height ** 2);
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.

Comment on lines +8 to +25
function toPounds(penceString) {
const penceStringWithoutTrailingP = penceString.substring(
0,
penceString.length - 1
);


const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
const pounds = paddedPenceNumberString.substring(
0,
paddedPenceNumberString.length - 2
);

const pence = paddedPenceNumberString
.substring(paddedPenceNumberString.length - 2)
.padEnd(2, "0");
return `£${pounds}.${pence}`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation is off.

Have you installed the prettier VSCode extension and enabled "Format on save/paste" on VSCode,
as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md
?

@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