Computer Science For First Examination In 2021 9618 · 11

Programming

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

2025 October-November · Paper 43 · Q2(d)

Constructs · 5 marks · official answer ready

2 A program reads string data from a text file into a linear queue and then compresses the data. The queue is created using the global 1D array Queue. The queue can store up to 10…

2025 October-November · Paper 43 · Q9(a)

Programming basics · 22 marks

(a) Write program code to declare and initialise Queue, QueueHead, QueueTail and NumberItems Save your program as Question2_N25. Copy and paste the program code into part 2(a) in …

2025 October-November · Paper 43 · Q9(b)

Programming basics · 25 marks

(b) The function Enqueue() takes a string as a parameter. The function checks if the queue is full, and returns Boolean FALSE if the queue is full. If the queue is not full, the p…

2025 October-November · Paper 43 · Q9(c)

Programming basics · 23 marks

(c) The function Dequeue() returns the string "False" if the queue is empty. If the queue is not empty, the function returns the next element in the queue. The function updates th…

2025 October-November · Paper 43 · Q9(d)

Programming basics · 25 marks

(d) The text file BinaryData.txt stores individual binary digits, '1' and '0'. Each digit is on a new line. For example, the first line in the text file stores '1', the second lin…

2025 October-November · Paper 43 · Q9(f)(i)

Programming basics · 22 marks

(i) Write program code for the main program to: • call ReadData() • call Compress() • output the content of the compressed string. Save your program. Copy and paste the program co…

2025 October-November · Paper 43 · Q9(f)(iii)

Structured programming · 30 marks

(iii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot(s) into part 3(a)(iii) in the evidence document. [1] (b) The program …

2025 October-November · Paper 43 · Q9(f)(iv)

Constructs · 21 marks

(iv) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot(s) into part 3(b)(iv) in the evidence document. [1] 14 15 16 reasonabl…

2025 May-June · Paper 23 · Q1(a)(i)

Structured programming · 2 marks · official answer ready

(i) State two reasons why the programmer decides to use modules. 1 ................................................................................................................…

2025 May-June · Paper 23 · Q5(b)

Constructs · 24 marks

(b) Once the program has been completed, it is tested using the walkthrough method. Describe the walkthrough method and explain how it can be used to identify errors. ............…

2025 May-June · Paper 23 · Q7(a)(i)

Structured programming · 5 marks · official answer ready

(i) Write pseudocode for module UpdateVisit() Assume the customer has made at least one previous visit. ...........................................................................…

2025 May-June · Paper 23 · Q7(a)(ii)

Constructs · 1 mark · official answer ready

(ii) The programmer decides to amend the UpdateVisit() module so that loyalty points are further increased if the customer visits the coffee shop the same day of the week as their…

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

Constructs · 0 marks · official answer ready

(b) Write pseudocode statements to declare the composite data type, Booking, to hold data about taxi bookings. The data required includes: • booking number (any combination of let…

2025 May-June · Paper 31 · Q5(a)

Programming basics · 2 marks · official answer ready

(a) Write the Boolean logic expression that corresponds to the given truth table as the sum-of-products. Z = ......................................................................…

2025 May-June · Paper 31 · Q5(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 31 · Q6

Constructs · 4 marks · official answer ready

6 Describe the process of executing a program using an interpreter. ...............................................................................................................…

2025 May-June · Paper 31 · Q8(a)

Constructs · 2 marks · official answer ready

8 (a) Describe what is meant by multi-tasking and how it benefits process management. .............................................................................................…

2025 May-June · Paper 31 · Q8(b)

Constructs · 4 marks · official answer ready

(b) Explain the function of the shortest remaining time scheduling routine and give a benefit of this routine. Function ...........................................................…

2025 May-June · Paper 33 · Q1(a)

Constructs · 4 marks · official answer ready

(a) Write pseudocode statements to declare the composite data type VideoLibrary to hold data about each video in the collection. This data includes: • identity code (any combinati…

2025 May-June · Paper 33 · Q3(a)

Programming basics · 2 marks · official answer ready

(a) Write the Boolean logic expression that corresponds to the given truth table as the sum-of-products. Z = ......................................................................…