Computer Science For First Examination In 2021 9618 · 11

Programming

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

2025 May-June · Paper 33 · Q3(b)(ii)

Programming basics · 2 marks · official answer ready

(ii) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal sum-of-products. [2]

2025 May-June · Paper 33 · Q12(c)

Constructs · 2 marks · official answer ready

(c) Describe two ways in which the performance of a sort routine is affected by the data to be sorted. 1 ..........................................................................…

2025 May-June · Paper 41 · Q1(b)

Structured programming · 6 marks · official answer ready

(b) The function Enqueue(): • takes an integer as a parameter • checks if the queue is full • returns FALSE if the queue is full • stores the parameter in the next position in the…

2025 May-June · Paper 41 · Q2(c)

Structured programming · 5 marks · official answer ready

(c) The procedure StoreData(): • takes two parameters: a 1D array DataToStore and a filename • opens the text file with the filename that is passed as a parameter • appends each i…

2025 May-June · Paper 41 · Q2(e)(ii)

Programming basics · 2 marks · official answer ready

(ii) Test your program. Input the text "TheData.txt" when prompted. Take a screenshot of the output(s) and a screenshot showing the content of the file that stores the red numbers…

2025 May-June · Paper 41 · Q3(e)(ii)

Constructs · 1 mark · official answer ready

(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 3(e)(ii) in the evidence document. [1] 10 11 12 Permission t…

2025 May-June · Paper 42 · Q1(c)

Constructs · 4 marks · official answer ready

(c) The function Pop() returns the next item from the stack. The function returns "–1" if the stack is empty. Write program code for Pop() Save your program. Copy and paste the pr…

2025 May-June · Paper 42 · Q1(d)

Structured programming · 6 marks · official answer ready

(d) The text file StackData.txt stores numbers and mathematical operators. Each number and operator are on a new line in the text file. The mathematical operators used in this pro…

2025 May-June · Paper 42 · Q1(e)

Constructs · 0 marks · official answer ready

(e) The values stored in the stack are used to perform mathematical operations. A total is initialised to the first value in the stack. The first value in the stack will always be…

2025 May-June · Paper 42 · Q2(c)

Structured programming · 13 marks · official answer ready

(c) The hash value is calculated from the key field using the formula: Key MOD 200 The function CalculateHash() takes a key field as a parameter and calculates and returns the has…

2025 May-June · Paper 42 · Q2(d)

Structured programming · 17 marks · official answer ready

(d) The procedure InsertIntoHash(): • takes a record of type NewRecord as a parameter • uses CalculateHash() to calculate the hash value for the key field in the record • checks i…

2025 May-June · Paper 42 · Q3(d)(iii)

Constructs · 2 marks · official answer ready

(iii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 3(d)(iii) in the evidence document. [2] Permission to repro…

2025 May-June · Paper 43 · Q1(d)

Constructs · 6 marks · official answer ready

(d) The text file QueueData.txt stores positive integers. Each integer is on a new line in the file. The procedure CreateQueue(): • opens the file QueueData.txt • reads in each li…

2025 May-June · Paper 43 · Q2(c)

Structured programming · 2 marks · official answer ready

(c) The procedure OutputArray() takes an array of integers as a parameter. The procedure outputs each element in the array from the first element to the last element. The output i…

2025 May-June · Paper 43 · Q3(c)(ii)

Constructs · 2 marks · official answer ready

(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 3(c)(ii) in the evidence document. [2] 11 12 Permission to r…

2025 May-June · Paper 43 · Q4(c)

Structured programming · 3 marks

4 56 67 44 43 32 31 345 45 6 54 1 Save your program as Question2_J25. Copy and paste the program code into part 2(a) in the evidence document. [1] (c) The procedure OutputArray() …

2025 May-June · Paper 43 · Q4(c)(i)

Structured programming · 6 marks

4 56 67 44 43 32 31 345 45 6 54 1 Save your program as Question2_J25. Copy and paste the program code into part 2(a) in the evidence document. [1] (c) The procedure OutputArray() …

2024 October-November · Paper 11 · Q8(b)

Constructs · 2 marks · official answer ready

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

2024 October-November · Paper 21 · Q1(a)

Constructs · 2 marks · official answer ready

(a) The pseudocode contains a logical error. Identify the error and suggest a correction. Error ...................................................................................…

2024 October-November · Paper 21 · Q1(b)(i)

Constructs · 1 mark · official answer ready

(i) Identify a more appropriate way of representing the tax rate values in the final program. .....................................................................................…