Skip to content

Conversation

@Alaa-Tagi
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

Changelist

I have created a PR after making all the tasks required.

Questions

No questions.

@Alaa-Tagi Alaa-Tagi 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. Module-Structuring-And-Testing-Data The name of the module. labels Oct 5, 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 Oct 13, 2025
Copy link

@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 @Alaa-Tagi! You did a great job working on the exercises but there are several things you need to revisit.

// call the function capitalise with a string input
// interpret the error message and figure out why an error is occurring

function capitalise(str) {

Choose a reason for hiding this comment

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

This function has another syntax error after you made some changes. Could you please fix it?

// =============> write your new code here :
/*
function capitalise(str) {
let cap = `${str[0].toUpperCase()}${str.slice(1)}`;

Choose a reason for hiding this comment

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

This works well but something to consider for future is that variable names should be more descriptive, so it's easier for readers of your code to understand what this variable holds.

//The correct code :
const decimalNumber = 0.5;

function convertToPercentage(decimalNumber) {

Choose a reason for hiding this comment

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

This works nicely but as an optional exercise, could you think of a way to simplify the code within this function?

// Predict and explain first...

// =============> write your prediction here
// =============> write your prediction here : There is no return statement for the parameters.

Choose a reason for hiding this comment

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

Could you please explain your prediction better? What does the no return statement for the parameters mean and how do you think it affects the function behaviour?

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

// =============> write your explanation here
// =============> write your explanation here : /* The function multiply does not return any value, it only logs the result to the console. It returns undefined. To fix this, we need to add a return statement in the multiply function. */

Choose a reason for hiding this comment

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

excellent explanation!

// return the BMI of someone based off their weight and height
}
const bmi = weight / (height * height);
return bmi.toFixed(1);

Choose a reason for hiding this comment

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

This works fine but something to keep in mind is that .toFixed() would return a string. It can be okay in this case as we don't have a strict requirement for the return type but something to be careful about while using this method.

const upperCase = name.toUpperCase(); // Convert the string to uppercase
return upperCase.replaceAll(" ", "_"); // Replace all spaces with underscores
}
console.log(snakeItUp("alaa tagi is my name"));

Choose a reason for hiding this comment

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

Are you calling the right function here?


// You should call this function a number of times to check it works for different inputs

function toPounds(penceToPound) {

Choose a reason for hiding this comment

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

Very cleanly written code with super descriptive variable names. Great job!


// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
// =============> write your answer here
// =============> write your answer here : "00", because num is converted to string and padded to 2 characters with "0". That's mean "1" becomes "01".

Choose a reason for hiding this comment

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

I think there is a typo in this answer, could you please double check if it's correct?

); // It's output is correct

//Fixing the function:
function formatAs12HourClockFixed(time) {
Copy link

@jennethydyrova jennethydyrova Oct 13, 2025

Choose a reason for hiding this comment

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

The test cases you added are good but some edge cases to consider:

  1. Passing invalid time such as "25:30" or "15:78"
    2 Passing an empty string "" as parameter

Edit: I edited my comment to make it simpler for you

Copy link
Author

Choose a reason for hiding this comment

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

hi @jennethydyrova i have corrected all the things that you have mentioned earlier and push it to git .
would you please see if it correct?

Thanks

Choose a reason for hiding this comment

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

Hi @Alaa-Tagi, could you please double check if all tests are passing this file? It looks like tests are correct but they would fail.

@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 Oct 14, 2025
@Alaa-Tagi Alaa-Tagi added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 23, 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 Oct 24, 2025
@jennethydyrova
Copy link

hi @Alaa-Tagi! I think you are almost there with this PR but your formatAs12HourClockFixed still returns some interesting results when you pass:

  1. Invalid time such as "25:30" or "15:78"
  2. An empty string "" as parameter

Can you add assertions for these inputs and see what's missing in your function?

@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 Oct 24, 2025
@Alaa-Tagi Alaa-Tagi added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 24, 2025
@jennethydyrova
Copy link

Great job @Alaa-Tagi!

@jennethydyrova jennethydyrova added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants