London | 26-ITP-JAN | Shuheda Begum | Sprint 2 | Structuring and Testing Data#984
London | 26-ITP-JAN | Shuheda Begum | Sprint 2 | Structuring and Testing Data#984codebyshay wants to merge 26 commits intoCodeYourFuture:mainfrom
Conversation
Questions Answered
This comment has been minimized.
This comment has been minimized.
5 similar comments
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.
This comment has been minimized.
This comment has been minimized.
Fixed code and tested.
Added my prediction
Code amended and working.
Explanation of syntax error and new code
Prediction and explanation
New Code
Prediction and explanation
New code updated
Predicted, anded explanation and fixed code.
Fixed spelling
Made notes and built a code to calculate bmi.
Made notes for code requirements. Used MDN. Developed code that runs.
Located original code Made notes Worked on a code
Questions answered
Code fixed. Tested with various times.
Sprint-2/2-mandatory-debug/2.js
Outdated
| const num = 103; | ||
| //const num = 103; |
There was a problem hiding this comment.
Note: Deleting the global num is optional. If we declared a parameter that's also named num, then within the function block, the identifier num is resolved to the parameter num.
If you are interested in the topic, you can looking up these two concepts, identifier scope and identifier resolution, in the context of JavaScript programming. ChatGPT can give a good explanation.
|
|
||
| function calculateBMI(weight, height) { | ||
| const bmi = weight / (height * height); | ||
| return bmi.toFixed(1); |
There was a problem hiding this comment.
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.|
The Cangelist section of the PR description does not quite describe what you have changed. Can you update it accordingly to better reflect what you have changed on this PR branch? |
Used the notes to write 'if' statements that reflect the requirements. e.g. "Acute angle" for angles greater than 0° and less than 90° becomes, if (angle > 0 && angle < 90) {
return "Acute angle";
I wrote tests to cover all cases, including boundary and invalid.
Defined proper fractions and implemented isProperFraction function.
Add comprehensive tests for isProperFraction including edge cases
Add getCardValue logic for ranks and suits.
Add comprehensive tests including error handling for invalid cards
Add comprehensive Jest tests covering all angle cases.
Add comprehensive Jest tests covering positive, negative, zero, and edge cases for isProperFraction.
Add Jest tests for Ace, number, face, and invalid cards for getCardValue.
Self checklist
Changelist
i have fixed errors on 0.js file.