Photo AI

The leisure centre runs fitness classes - Edexcel - GCSE Computer Science - Question 3 - 2021 - Paper 1

Question icon

Question 3

The-leisure-centre-runs-fitness-classes-Edexcel-GCSE Computer Science-Question 3-2021-Paper 1.png

The leisure centre runs fitness classes. (a) This is an algorithm used by instructors to check the Body Mass Index (BMI) of people attending their classes. Complet... show full transcript

Worked Solution & Example Answer:The leisure centre runs fitness classes - Edexcel - GCSE Computer Science - Question 3 - 2021 - Paper 1

Step 1

Complete the algorithm by filling in the boxes.

96%

114 rated

Answer

  1. Function Declaration: Line 4 can be filled with FUNCTION bmiCalc(pMass, pHeight) to specify the parameters for mass and height.

  2. Calculation Return: Line 22 should be filled with SET calc = pMass / (pHeight * pHeight) to correctly calculate BMI using the formula:

    ext{BMI} = rac{ ext{mass}}{ ext{height}^2}

  3. Matching Order: Match the parameter names to the variables being used; this is done by ensuring consistent naming throughout the function.

Step 2

State the process being carried out at line 7 of the algorithm.

99%

104 rated

Answer

At line 7, the algorithm is executing a loop that iterates through each element in the arrayAttendance. This means it is processing each value of attendance for the fitness classes.

Step 3

Complete the trace table showing the execution of the algorithm with these five values.

96%

101 rated

Answer

countTMDISPLAY
1252525
2402020
36521.6721.67
48521.2521.25
51002020

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;