Question 19(e)(iii) 2016 · October-November · Paper 23 · 7 marks
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Show text version of question
Question 19
Part (e)
(iii)
Question 19
ENDWHILE
Question 7
Ahmed designs this as a function ProductCodeSearch.
The function returns an integer value as follows:
- if the product code is found, it returns the index position of the 1D array PCode being
- if the product code is not found, the function returns -1
searched
Write program code for function ProductCodeSearch.
Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should show a comment statement for each variable used with its data type.
Programming language ...................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
......................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[6]
Question 18
5 Study the following pseudocode statements.
CONST Pi = 3.1 : REAL
DECLARE Triangle, Base, Height, Radius, Cone : REAL
DECLARE a, b, c, Answer2 : INTEGER
DECLARE Answer1 : BOOLEAN
Base 2.6
Height 10
Triangle (Base * Height) / 2
Radius 1
Height 2
Cone 2 * Pi * Radius * (Radius + Height)
a 13
b 7
c 3
Answer1 NOT((a + b + c) > 28)
Total 34
Total Total - 2
Answer2 a + c * c
Give the final value assigned to each variable.
(iii)
Answer1 ...................................
Why this question appears here
82% assigned-topic match · Data types and structures › Data types and records
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 9608_w16_qp_23.pdf
