Computer Science 2210 · 8

8.1 Programming concepts

223 questions in this subtopic. Open a question to solve it and check the official answer.

Reset
2025 May-June · Paper 12 · Q5(c)(ii)

Programming concepts · 6 marks · official answer ready

(ii) A patient is making a payment through a secure connection. The secure connection is created using the secure socket layer (SSL) protocol. Explain how a secure connection is c…

2025 May-June · Paper 21 · Q4(a)

Programming concepts · 5 marks · official answer ready

(a) Write an algorithm using pseudocode to: • input the telephone number • extract the 2-digit country code • output the matching country • output ‘Unknown’ if there is no matchin…

2025 May-June · Paper 21 · Q4(b)

Programming concepts · 3 marks · official answer ready

(b) Explain how you could change the algorithm to repeatedly prompt for the telephone number until the number entered is 13 characters in length. Any code used must be fully expla…

2025 May-June · Paper 21 · Q5

Programming concepts · 4 marks · official answer ready

5 Two library routines used in programming are MOD and DIV. State the purpose of each of the library routines. Give one example pseudocode statement for each of the library routin…

2025 May-June · Paper 21 · Q9(a)

Programming concepts · 2 marks · official answer ready

(a) Write pseudocode statements to declare the variables A and B ..................................................................................................................…

2025 May-June · Paper 21 · Q9(b)

Programming concepts · 6 marks · official answer ready

(b) The function Odds(X) returns ‘Odd’ if the value of X is an odd number and returns ‘Even’ if the value of X is an even number. Write pseudocode statements to: • define the func…

2025 May-June · Paper 22 · Q2

Programming concepts · 3 marks · official answer ready

2 A fence measuring 2 metres in height and 20 metres in length needs painting. The area of the fence needs to be calculated so that enough paint for the job is purchased. After th…

2025 May-June · Paper 22 · Q5(c)

Programming concepts · 4 marks · official answer ready

(c) Explain how you could change the corrected algorithm so that it will also: • find the height of the tallest person. • output the height of the tallest person at the end of the…

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

Programming concepts · 1 mark · official answer ready

(b) State the purpose of the algorithm on page 6. .................................................................................................................................…

2025 May-June · Paper 22 · Q6(c)

Programming concepts · 3 marks · official answer ready

(c) Explain how the algorithm knows when all the letters in the word have been checked so that it can stop checking. ..............................................................…

2024 May-June · Paper 21 · Q2(a)

Programming concepts · 4 marks · official answer ready

(a) Draw one line to link each description to the most appropriate programming concept. Not all programming concepts will be used. Description Programming concept function a subro…

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

Programming concepts · 2 marks · official answer ready

(b) Write the pseudocode to use a procedure named Average that passes the values 25 and 50 to the procedure. ......................................................................…

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

Programming concepts · 3 marks · official answer ready

(c) Outline the role of procedures and functions in creating a program that is easier to maintain. ................................................................................…

2024 May-June · Paper 21 · Q3

Programming concepts · 4 marks · official answer ready

3 State what is meant by the data types integer and real. Give an example of each. Integer ........................................................................................…

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 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 …