Skip to content

Conversation

@PaymanIB
Copy link

@PaymanIB PaymanIB commented Nov 2, 2025

  • 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

in this PR: Sprint 2 Coursework completed. errors fixed and questions answered

@PaymanIB PaymanIB added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 2, 2025
@jennethydyrova jennethydyrova added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 3, 2025
Copy link
Contributor

@jennethydyrova jennethydyrova left a comment

Choose a reason for hiding this comment

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

Hi @PaymanIB! Very good work on these exercises! I left several comments you need to address. You also have some extra file in the commit you pushed, can you please remove it?

// Predict and explain first...
// =============> write your prediction here

// it gives us an error.
Copy link
Contributor

Choose a reason for hiding this comment

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

You should try to be more specific, what type of error?

Comment on lines +16 to +17
let str1 = `${str[0].toUpperCase()}${str.slice(1)}`;
return str1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you use let here? Also, can you think of a way to simplify these two lines?

// Why will an error occur when this program runs? yes
// =============> write your prediction here
// decimalNumber is declared before and can not be declared again.
// console.log(decimalNumber) should be console.log(convertToPercentage)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is correct but why is that a case? Why we can't do console.log(decimalNumber)?

// Finally, correct the code to fix the problem
// =============> write your new code here
function convertToPercentage(decimalNumber) {
//const decimalNumber = 0.5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep the code clean and remove all scratch work and commented out code (within functions you wrote).

Comment on lines +27 to +29
const percentage = `${decimalNumber * 100}%`;

return percentage;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you think of a way to simplify this?

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

// =============> write your explanation here
//the return statement is not returning any value. a+b declared after 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 are right about the return but be careful with second part, a + b is not not a declaration, it's an expression.


// Predict the output of the following code:
// =============> Write your prediction here
// the result will be 3 times
Copy link
Contributor

Choose a reason for hiding this comment

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

What does it mean?

Comment on lines +11 to +16
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.

Do you have prettier installed? If no, I would recommend installing it and formatting your code. This is not a correct indentation, makes your code look messier

Comment on lines +7 to +8
const totalMinutes = (seconds - remainingSeconds) / 60; //1
const remainingMinutes = totalMinutes % 60; //1
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need these comments here?

@jennethydyrova jennethydyrova added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 3, 2025
@jennethydyrova
Copy link
Contributor

Hi @PaymanIB! Do you want to do another round of review? If yes, please change label to needs review and request review.

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