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 22 · Q3(b)

Constructs · 3 marks · official answer ready

(b) State three benefits of using an array of records to store the data for all items. 1 ..........................................................................................…

2024 May-June · Paper 22 · Q6(a)

Constructs · 7 marks · official answer ready

(a) Up to 16 characters can be displayed. Track titles longer than 16 characters will need to be trimmed as follows: • Words must be removed from the end of the track title until …

2024 May-June · Paper 22 · Q7(b)(ii)

Programming basics · 1 mark · official answer ready

(ii) Identify the input sequence that will cause the minimum number of state changes in the transition from S1 to S4. .............................................................…

2024 May-June · Paper 22 · Q8(c)

Constructs · 8 marks · official answer ready

(c) Two modules are defined: Module Description DeleteComment() • called with a parameter of type string representing a line of (already written) pseudocode from a student’s proje…

2024 May-June · Paper 23 · Q1(a)(ii)

Structured programming · 3 marks · official answer ready

(ii) Describe how the modification would be implemented. ..........................................................................................................................…

2024 May-June · Paper 23 · Q4(a)

Programming basics · 6 marks · official answer ready

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

2024 May-June · Paper 23 · Q4(b)(i)

Programming basics · 2 marks · official answer ready

(i) Identify a suitable data structure that could be used to store the different total values. ....................................................................................…

2024 May-June · Paper 23 · Q4(b)(ii)

Programming basics · 3 marks · official answer ready

(ii) Describe three benefits of using the data structure given in part (b)(i). 1 ..................................................................................................…

2024 May-June · Paper 23 · Q6(b)(i)

Structured programming · 2 marks · official answer ready

(i) Write pseudocode for the new module header. ...................................................................................................................................…

2024 May-June · Paper 41 · Q1(a)

Programming basics · 1 mark · official answer ready

(a) The integer numbers will be stored in the global 1D array, DataStored, with space for up to 20 integers. The global variable NumberItems stores the quantity of items the array…

2024 May-June · Paper 41 · Q1(c)(ii)

Programming basics · 0 marks · official answer ready

(ii) Test your program by inputting the following data in the order given: 30 5 3 9 4 1

2024 May-June · Paper 41 · Q2(d)(i)

Structured programming · 6 marks · official answer ready

2 Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 1(c)(ii) in the evidence document. [2] (d) The procedure BubbleSort() uses a bubbl…

2024 May-June · Paper 41 · 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 41 · 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…

2024 May-June · Paper 42 · Q1(a)

Structured programming · 6 marks · official answer ready

(a) The procedure ReadWords(): • takes a file name as a parameter • opens the file and reads in the data • stores the main word in the first element in WordArray • stores each ans…

2024 May-June · Paper 42 · Q1(b)

Constructs · 4 marks · official answer ready

(b) The main program asks the user to enter "easy", "medium" or "hard" and calls ReadWords()with the filename that matches the user’s input. For example, if the user enters "easy"…

2024 May-June · Paper 42 · Q2(b)(iii)

Constructs · 4 marks · official answer ready

(iii) The method OutputTree()outputs the left pointer, the data and the right pointer for each node that has been inserted into the tree. The outputs are in the order they are sav…

2024 May-June · Paper 43 · Q1(a)

Programming basics · 1 mark · official answer ready

(a) The integer numbers will be stored in the global 1D array, DataStored, with space for up to 20 integers. The global variable NumberItems stores the quantity of items the array…

2024 May-June · Paper 43 · Q1(c)(ii)

Programming basics · 0 marks · official answer ready

(ii) Test your program by inputting the following data in the order given: 30 5 3 9 4 1

2024 May-June · Paper 43 · Q2(d)(i)

Structured programming · 6 marks · official answer ready

2 Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 1(c)(ii) in the evidence document. [2] (d) The procedure BubbleSort() uses a bubbl…