Past-paper question · 2016 May-June · Paper 22 · Q1(b)

Question 1(b) 2016 · May-June · Paper 22 · 5 marks

Original past-paper question for 1(B)
Original past-paper question for 1(B)
Reveal official mark-scheme answer Official mark-scheme answer for 1(B)Official mark-scheme answer for 1(B)

Official answer for Question 1

Part (b)

Part (b)

Any five from:

  • initialise total weight of order
  • input number of sacks for each type outside loop(s)
  • loop for order completion
  • input weight
✓
inside loop(s)
  • add weight of accepted sack to total weight
  • output total weight
✓
outside all loop(s)
  • appropriate prompts for input number of sacks for each type and input weight
[5]
✓
Sample Answer 1
✓
INPUT 'Number of sand sacks ordered ' num_sand_ordered
✓
INPUT 'Number of cement sacks ordered ' num_cement_ordered
✓
INPUT 'Number of gravel sacks ordered ' num_gravel_ordered
✓
total_weight ← 0
✓
FOR Counter ← 1 TO num_sand_ordered
✓
INPUT 'weight of sack of sand ' sack_weight
✓
total_weight ← total_weight + sack_weight
✓
NEXT Counter
✓
FOR Counter ← 1 TO num_cement_ordered
✓
INPUT 'weight of sack of cement ' sack_weight
✓
total_weight ← total_weight + sack_weight
✓
NEXT Counter
✓
FOR Counter ← 1 TO num_gravel_ordered
✓
INPUT 'weight of sack of gravel' sack_weight
✓
total_weight ← total_weight + sack_weight
✓
NEXT Counter
✓
Print 'Total weight of sacks is ' total_weight
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge O Level – May/June 2016
✓
2210

Question 22

✓
Sample Answer 2
✓
INPUT 'Number of sand sacks ordered ' num_sand_ordered
✓
INPUT 'Number of cement sacks ordered ' num_cement_ordered
✓
INPUT 'Number of gravel sacks ordered ' num_gravel_ordered
✓
total_sacks_ordered ← num_sand_ordered + num_cement_ordered +
✓
num_gravel_ordered
✓
total_weight ← 0
✓
FOR Counter ← 1 TO total_sacks_ordered
✓
INPUT 'weight of sack ' sack_weight
✓
total_weight ← total_weight + sack_weight
✓
NEXT Counter
✓
Print 'Total weight of sacks is ' total_weight

Mark scheme 2210_s16_ms_22.pdf →

Show text version of question

Question 1

Part (b)

Part (b)

Write an algorithm to complete Task 2, using either pseudocode, programming statements

or a flowchart. You can assume that the weight and contents have already been checked and accepted in Task 1. You do not need to output the number of sacks rejected.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...............................................................................................................................................[5]

Question 5

Topic relevance

Why this question appears here

98% assigned-topic match · Algorithm design and problem-solving

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 2210_s16_qp_22.pdf

Keep practising this topic