-
-
Notifications
You must be signed in to change notification settings - Fork 221
West Midlands | ITP-Sep-2025 | Ahmad Ehsas | Sprint 2 | Structuring and Testing Data #734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…e error. and finally, rewrote the code to fix the problem.
…n incorrectly. i explained the error and rewrote the code as a comment.
…ssue and fixed the code.
…hen explained it in comment how to calculate the BMI.
…on many times for different inputs.
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
1 similar comment
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
3 similar comments
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
1 similar comment
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
return percentage; | ||
} | ||
|
||
console.log(decimalNumber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think console.log() is calling an undeclared variable decimalNumber
instead of the function convertToPercentage(0.5)
? You have corrected the function on line 25.
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`); | ||
|
||
// =============> write your explanation here | ||
// =============> write your explanation here: in the code above, the function Sum is not returning because the return function is not defined and it is written incorrectly. The return function should be written before the a + b values.// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could say the statement a+b
is unreachable because there is an empty return statement
before it.
You have fixed the code correctly.
|
||
// a) When formatTimeDisplay is called how many times will pad be called? | ||
// =============> write your answer here | ||
// =============> write your answer here: When formatTimeDisplay is called four times pad will be called, one for remainingSeconds, one for remainingMinutes, one for totalMinutes and one for totalHours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function pad(num)
is called inside the formatTimeDisplay
function. And if we look inside, how many times do we see the function name pad
? we do see there are 3 different arguments being called by each.
|
||
// b) What is the value assigned to num when pad is called for the first time? | ||
// =============> write your answer here | ||
// =============> write your answer here: When pad is called for thee first time, num will be assigned the value of 1, which is the value of remainingSeconds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you spot where the function pad
is called first? which argument does it have?
|
||
// c) What is the return value of pad is called for the first time? | ||
// =============> write your answer here | ||
// =============> write your answer here: The return value of pad when called for the first time will be `01` because it pads the number 1 with a leading zero to make it two digits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you find out when the function pad
is called first from above, we can figure out return value here.
|
||
// d) What is the 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: When pad is called for the last time, num will be assigned the value of 0, which is the value of totalHours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like above, we can find out when a function is called first based on the order in which it is called in the series. In other words, which appears first in the series.
|
||
// 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: when pad is called for the last time, the return value will be `0` because it pads the number 0 with a leading zero to make it two digits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also change when we know the above.
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
1 similar comment
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
1 similar comment
Your PR description contained template fields which weren't filled in. Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
Self checklist
Changelist
I have completed all the mandatory coursework. which includes:
Questions
Ask any questions you have for your reviewer.