A sports centre writes a program to award points in a step challenge. Fig. 1 shows the calculation. The user enters a daily step number. The first 5000 step...

Assessment: Computer Science 4CP0 | Paper 2 Mock 01 | Written Paper 2 Subject: Computer Science - 4CP0

Question 1 Report

A sports centre writes a program to award points in a step challenge. Fig. 1 shows the calculation. The user enters a daily step number. The first 5000 steps earn no points. Each step above 5000 earns one point, but the daily points cap is 10000. The program is tested with values around both decision boundaries before the code is placed in the fitness app.

Fig. 1: step-points algorithmsteps ≤ 5000?yes: points ← 0nopoints ← steps - 5000points > 10000?yes: points ← 10000

(a) Identify the points for 5000 steps. [1]
(b) Write the points for 6200 steps. [1]
(c) State the points for 17000 steps. [1]
(d) Give one test value for the point at which the cap is first applied. [1]
(e) Use the figure to identify the maximum possible output. [1]

Answer Details

(a) 5000 steps meets steps <= 5000, so the output is 0 points. [1]

(b) Since 6200 is above 5000:

\[6200-5000=1200\]

The output is 1200 points. [1]

(c) For 17000 steps, the initial calculation is \(17000-5000=12000\). Since this exceeds the cap, the output is set to 10000 points. [1]

(d) The cap is first applied at 15001 steps. [1] At 15000 steps, the calculated points are exactly 10000; the condition is strictly points > 10000.

(e) The maximum possible output is 10000 points. [1]

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning