2025 Home

Question 11

Section 1: Software design and development, and Computer systems

A gym wants to encourage members to burn more calories than their monthly target.

It uses a program to calculate additional calories burned over a 12‑month period.

AprilMayJune
...6821.345129.894997.67...

The design below shows how a member’s average additional calories burned is calculated and displayed.

  1. Store each month’s additional calories burned
  2. Calculate the average additional calories burned
  3. Display the average additional calories burned

The data structurecalories is used to store additional calories burned each month.

The variable avgCalories is used to store the user’s average additional calories burned.

(a) Using a design technique of your choice, refine step 2.

4 marks

(b) A member’s average additional calories burned is displayed using the line of code below.

SEND avgCalories TO DISPLAY

This code displays the value below to a member.

5123.879

Using a programming language of your choice, rewrite this code to display the average additional calories to one decimal place.

2 marks

(c) If a member’s average additional calories burned is over 6000 calories, and they have a personal trainer at the gym, they will be given a 15% discount on their next session.

The code to implement this is shown below.

…
Line 27 SET memberDiscount TO 0.00
Line 28 <repeat for every gym member>
Line 29     IF avgCalories < 6000 AND trainer = TRUE
Line 30         SEND "Congratulations on a 15% discount" TO DISPLAY
Line 31         SET memberDiscount TO sessionCost * 0.15
Line 32     END IF
Line 33<end repeat>
…

(i) Identify the logical operator in the above code.

1 mark

(ii) It was identified that a member who burned 6578.1 average additional calories and who has a personal trainer did not receive the 15% discount.

State the type of error in the program and how the error can be corrected.

Type of error
Correction

2 marks

(d) After final testing, the program is run without requiring any further translation.

State the type of translator that has been used.

1 mark

(e) State the term used at the evaluation stage, to describe a program’s capability to handle unexpected or incorrect data being entered without crashing.

1 mark

(f) A member has written an e-mail to the gym manager.

State what can be done to ensure that, if intercepted, the e-mail cannot be read by others.

1 mark

(g) The gym manager wants to set up tablet computers at the door to carry out a survey as people leave the gym.

The survey should ask if they are a member or a pay‑as‑you‑go customer, and if they were attending the gym or a fitness class.

The survey should also ask people to rate their visit, from 1 to 10, and have a space for any additional comments.

Design a user interface for this survey.

4 marks