Symptom
Calling calculateCaloriesBurned(30, 12) (30 minutes, 12 cal/min) returns 0 instead of the expected 360. The function works correctly only when a third argument (body weight) is explicitly provided.
Expected
When no body weight is specified, the function should assume a default of 70 kg (average adult) and calculate calories normally: 30 * 12 * (70 / 70) = 360.
What you know
The function has a default parameter bodyWeight = 0. The formula multiplies by (bodyWeight / 70). With bodyWeight = 0, the result is always 0. The test also expects 0 -- it was written to match the buggy behavior.
Hints
TypeScript
TypeScript ready
Test Output
▶
Click "Run Tests" to execute your code