Computer Science For First Examination In 2021 9618 · 11

Programming

258 questions. Open a question to solve it and check the official answer.

2024 May-June · Paper 43 · Q4(e)(ii)

Programming basics · 14 marks

(ii) The procedure ChooseTree() needs amending. After the procedure has output the list of trees that meet all the requirements, the procedure needs to: • take as input the name o…

2024 May-June · Paper 43 · Q4(e)(iii)

Structured programming · 31 marks

(iii) Write program code to amend the main program to call ChooseTrees(). Test your program with the following tree requirements: • a maximum height of 400 cm • a maximum width of…

2023 October-November · Paper 11 · Q9(a)

Programming basics · 2 marks · official answer ready

9 (a) Explain the importance of feedback in a control system. .....................................................................................................................…

2023 October-November · Paper 11 · Q9(b)

Constructs · 3 marks · official answer ready

(b) Give one example of an embedded system and explain why it is an example of an embedded system. Example ........................................................................…

2023 October-November · Paper 12 · Q9(b)

Programming basics · 0 marks · official answer ready

(b) The current contents of main memory and selected values from the ASCII character set are given on page 15. Trace the program currently in memory using the trace table when the…

2023 October-November · Paper 12 · Q22

Constructs · 4 marks

22 END ... 100 0 101 0 ... 110 51 111 65 ASCII Character value 49 1 50 2 51 3 [4] 52 4 ... 65 A 66 B 67 C 68 D 16 reasonable effort has been made by the publisher (UCLES) to trace…

2023 October-November · Paper 13 · Q9(a)(ii)

Constructs · 2 marks · official answer ready

(ii) Identify two differences between special purpose registers and general purpose registers. 1 ..................................................................................…

2023 October-November · Paper 21 · Q1(b)

Programming basics · 3 marks · official answer ready

(b) The pseudocode contains four assignments to variable Level. One of these assignments will never be performed. Identify this assignment and explain why this is the case. ......…

2023 October-November · Paper 21 · Q2(a)

Constructs · 5 marks · official answer ready

2 (a) An algorithm is expressed as follows: • input 100 numbers, one at a time • keep a total of all numbers input that have a value between 30 and 70 inclusive and output this to…

2023 October-November · Paper 21 · Q2(b)

Constructs · 2 marks · official answer ready

(b) Sequence is one programming construct. Identify two other programming constructs that will be required when the algorithm is converted into pseudocode. Construct 1 ...........…

2023 October-November · Paper 21 · Q4(b)

Constructs · 11 marks · official answer ready

(b) The global array is changed to a 2D array, organised as 150 rows by 2 columns. It is declared in pseudocode as follows: DECLARE Data : ARRAY[1:150, 1:2] OF STRING The algorith…

2023 October-November · Paper 21 · Q5(a)

Constructs · 3 marks · official answer ready

(a) The pseudocode contains three errors due to the incorrect use of operators. Identify each error and state the correction required. 1 ..........................................…

2023 October-November · Paper 21 · Q5(b)(i)

Constructs · 2 marks · official answer ready

(i) Explain the problem with the algorithm. .......................................................................................................................................…

2023 October-November · Paper 21 · Q6(a)

Structured programming · 7 marks · official answer ready

(a) A new procedure MyOutput() will take a string and a Boolean parameter. MyOutput() may be called repeatedly and will use concatenation to build a string using a global variable…

2023 October-November · Paper 21 · Q7

Programming basics · 5 marks · official answer ready

7 An algorithm is represented by a state-transition diagram. The table shows the inputs, outputs and states for the algorithm: Current state Input Output Next state S1 A1 X1 S2 S2…

2023 October-November · Paper 22 · Q1(c)

Constructs · 3 marks · official answer ready

(c) The data that needs to be stored for each customer order in part (a) is not all of the same type. Describe an effective way of storing this data for many customer orders while…

2023 October-November · Paper 22 · Q8(a)

Constructs · 15 marks · official answer ready

(a) Write pseudocode for the procedure Count(). ...................................................................................................................................…

2023 October-November · Paper 22 · Q8(c)(i)

Constructs · 12 marks · official answer ready

(i) Describe the circumstances and explain the problem. Circumstances .............................................................................................................…

2023 October-November · Paper 23 · Q1(a)

Programming basics · 4 marks · official answer ready

(a) The following table shows four valid pseudocode assignment statements. Complete the table by giving the data type that should be used to declare the variable underlined in eac…

2023 October-November · Paper 23 · Q8(b)(ii)

Structured programming · 58 marks

(ii) The design is modified and Sub-9() is changed to a procedure. The procedure will be called with a single parameter of type MyType. Write the pseudocode header for procedure S…