Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 2 | coursework - #1424
Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 2 | coursework#1424Tobias-Amaechina wants to merge 49 commits into
Conversation
…unction with argument tobias which worked
…error occured at line 9 as pasted in the file
…ble decimalNumber, and the refence error occurs to show that the variable decimalNumber is not a global varaible
…be passed during function call
…ion printed a value and the one ouside that called the fuction using template literal produce undefine
… statement before the expression a +b could be reached
…ment and it worked
…t output '00:00am' instead of '12:00am'
…get output' for the assertion to work
…dnight code in the function body as noticed that assertion still fails
…here is no leading zeros
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
LonMcGregor
left a comment
There was a problem hiding this comment.
Good work on these tasks - they're almost all done. Just a few small comments
| // return the BMI of someone based off their weight and height | ||
| } No newline at end of file | ||
| } | ||
| console.log(calculateBMI(70, 1.73)); // should return 23.4 No newline at end of file |
There was a problem hiding this comment.
The calculation works here, but be careful about what the task is asking. The function should be returning the BMI to 1 decimal place. Your function is returning a string. How would you need to change this to match the task specification?
There was a problem hiding this comment.
Updated the return value now to number instead of string
| return `${hours}:00 pm`; | ||
| } | ||
| if (hours===0){ | ||
| return `${12}:00 am`; |
There was a problem hiding this comment.
Do you need to be using a template string here if the content is a number?
There was a problem hiding this comment.
remove the template string from the expression
|
All review issues resolved now |
|
Perfect! Task complete now |
|
Closing PR because the May ITP run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
I refactored the formatAs12HourClock function and enhanced the associated test suite to correctly handle edge‑case time conversions, specifically Midnight (00:00:00) and Midday (12:00:00). It also includes several clarity and consistency, I also improvements across the codebase.
I did Identified and fixed a scope issue involving a global variable.
Explained why the earlier version of the code failed and how the fix resolved the issue.
Reused logic from Sprint‑1 by extracting it into a properly named function.
I Implemented a reusable function with clear naming conventions.
I Called the function with two arguments and verified correct output via console logging.
Added a missing return statement to ensure the function produced a usable result.