Past-paper question · 2023 May-June · Paper 21 · Q6

Question 6 2023 · May-June · Paper 21 · 6 marks

Original past-paper question for 6
Original past-paper question for 6
Original past-paper question for 6
Reveal official mark-scheme answer Official mark-scheme answer for 6

Official answer for Question 6

✓
PROCEDURE Mix()

Question 6

✓
DECLARE Count, Total ThisNum : INTEGER
✓
DECLARE ThisUser, ThisSample : INTEGER
✓
FOR ThisSample 1 TO 128
✓
Count 0
✓
Total 0
✓
FOR ThisUser 1 TO 6
✓
IF Sample[ThisUser, ThisSample] > 10 THEN
✓
Count Count + 1
✓
Total Total + Sample[ThisUser, ThisSample]
✓
ENDIF
✓
NEXT ThisUser
✓
Result[ThisSample] INT(Total / Count)
✓
NEXT ThisSample
✓
ENDPROCEDURE
✓
Mark as follows:

Question 1

✓
Declaration and initialisation before inner loop of Count and Total

Question 2

✓
Outer Loop for 128 iterations

Question 3

✓
Inner loop for six iterations

Question 4

✓
Test for sample > 10 in a loop

Question 5

✓
and if true sum Total and increment Count

Question 6

✓
Calculate average value and assign to Result array after inner loop
✓
and within outer loop

Question 7

✓
Use of INT()/ DIV to convert average to integer
✓
9618/21
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2023
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s23_ms_21.pdf →

Show text version of question

Question 6

A
video-conferencing program supports up to six users. Speech from each user is sampled and

digitised (converted from analogue to digital). Digitised values are stored in array Sample.

The array Sample consists of 6 rows by 128 columns and is of type integer. Each row contains 128 digitised sound samples from one user.

The digitised sound samples from each user are to be processed to produce a single value which will be stored in a 1D array Result of type integer. This process will be implemented by procedure Mix().

A
procedure Mix() will:
  • calculate the average of each of the 6 sound samples in a column
  • ignore sound sample values of 10 or less
  • store the average value in the corresponding position in Result
  • repeat for each column in array Sample

The diagram uses example values to illustrate the process:

Sample: 5 20 3 5 6 60 4 6 20 4 2 4 70 30

Result: 20 20 35 40 46 25

Question 11

Write pseudocode for procedure Mix().

Assume Sample and Result are global.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[6]

Question 12

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

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 9618_s23_qp_21.pdf

Keep practising this topic