Computer Science 2210 · 8

Programming

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

2024 May-June · Paper 21 · Q4(c)

Programming concepts · 4 marks · official answer ready

(c) Explain how you should alter the original corrected algorithm to make sure that all the numbers entered are between 1 and 500 inclusive. If any numbers fall outside these limi…

2024 May-June · Paper 21 · Q5

Programming concepts · 5 marks · official answer ready

5 Write the pseudocode statements to perform this task: • accept the input of a whole number from 1 to 4 inclusive • use a CASE statement to: ○ output the number (1 to 4 inclusive…

2024 May-June · Paper 21 · Q7(b)

Programming concepts · 4 marks · official answer ready

(b) The function LENGTH(X) calculates the length of a string X Write the pseudocode statements to: • read the contents of the text file Quotation.txt into an appropriate string va…

2024 May-June · Paper 21 · Q10

Arrays · 15 marks · official answer ready

10 The one-dimensional (1D) array Clubs[] is used to store the names of 12 cricket clubs in a local sports league. The two-dimensional (2D) array Statistics[] is used to store, fo…

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

Programming concepts · 2 marks · official answer ready

(i) Write the pseudocode to make sure that the product code is six characters in length. ..........................................................................................…

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

Programming concepts · 2 marks · official answer ready

(ii) Write the pseudocode to make sure that the first two characters of the product code are “PD”. ................................................................................…

2024 May-June · Paper 22 · Q5

Programming concepts · 6 marks · official answer ready

5 A high-level programming language makes use of arithmetic, Boolean and logical operators. State how each type of operator is used. Give an example statement, in pseudocode, for …

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

Programming concepts · 4 marks · official answer ready

(a) Write an algorithm in pseudocode to total the numbers input and to output the total. You do not need to validate the input. ...................................................…

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

Programming concepts · 4 marks · official answer ready

(b) Write an algorithm in pseudocode to count and output the number of input values that are greater than 100. You do not need to validate the input. .............................…

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

Arrays · 5 marks · official answer ready

(a) Give a line number for each of these types of statement: Assignment statement .................................................................................................…

2024 May-June · Paper 22 · Q11

Arrays · 15 marks · official answer ready

11 A one-player game uses the two-dimensional (2D) array Grid[] to store the location of a secret cell to be found by the player in 10 moves. Each row and column has 5 cells. Star…

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

Programming concepts · 4 marks · official answer ready

(a) Draw one line to link each pseudocode statement to the most appropriate pseudocode use. Not all pseudocode uses will be required. Pseudocode statement Pseudocode use CALL Colo…

2023 October-November · Paper 22 · Q3(b)

Arrays · 4 marks · official answer ready

(b) A one‑dimensional (1D) array called Temperatures[] has 25 elements beginning at index 1. It holds values that range between –20 and 100 inclusive. Write a pseudocode algorithm…

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

Programming concepts · 5 marks · official answer ready

(b) Describe the changes you should make to the corrected algorithm to allow the name of a country to be input and to display only the stored cities from that country. You do not …

2023 October-November · Paper 22 · Q6(b)

Programming concepts · 2 marks · official answer ready

(b) Describe the purpose of the algorithm. ........................................................................................................................................…

2023 October-November · Paper 22 · Q7

Programming concepts · 5 marks · official answer ready

7 The string operation SUBSTRING(Quote, Start, Number) returns a string from Quote beginning at position Start that is Number characters long. The first character in Quote is in p…

2023 October-November · Paper 22 · Q8

Programming · 4 marks · official answer ready

8 Explain why a programmer would use procedures and parameters when writing a program. ............................................................................................…

2023 October-November · Paper 22 · Q11

Arrays · 15 marks · official answer ready

11 A wood flooring company stores the names of up to 100 customers in a one‑dimensional (1D) array Customers[]. A two‑dimensional (2D) array Quotations[] stores details of each cu…

2023 October-November · Paper 23 · Q2

Programming concepts · 1 mark · official answer ready

2 Tick (3) one box to show which library routine returns the remainder of a division. A DIV B MOD C RANDOM D ROUND [1] 3

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

Programming concepts · 4 marks · official answer ready

3 (a) Four pseudocode descriptions and five pseudocode keywords are shown. Draw one line to link each pseudocode description to the most appropriate pseudocode keyword. Not all ps…