Computer Science For First Examination In 2021 9618 · 11

Programming

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

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

Constructs · 3 marks · official answer ready

(ii) Describe the benefits of your answer to part (b)(i) with reference to this program. ..........................................................................................…

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

Constructs · 2 marks · official answer ready

(c) Give the appropriate data type for the variables in the following table, as used in the pseudocode: Variable name Data type HighRate TaxPayable [2]

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

Constructs · 1 mark · official answer ready

(d) The final CASE condition (> 200) in the pseudocode example could be replaced with a keyword. Give the keyword. ................................................................…

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

Structured programming · 4 marks · official answer ready

(i) The function will: • take an integer value as a parameter • return TRUE if the value is within the range 24 to 37, inclusive • otherwise return FALSE. Complete the table to de…

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

Constructs · 2 marks · official answer ready

(a) An algorithm uses the array DaysInMonth to calculate a ‘use-by’ date. An alternative design would involve the use of multiple selection statements. An array-based technique is…

2024 October-November · Paper 21 · Q8(c)

Constructs · 16 marks · official answer ready

(c) The requirement changes. Instead of a new file, the module described in part (b) needs to add the corresponding candidate ID for each paper that needs to be checked to an exis…

2024 October-November · Paper 22 · Q2(a)

Structured programming · 6 marks · official answer ready

(a) The function Conceal() will: • take a numeric string as a parameter representing the card number • return a string in which the asterisk character replaces all except the last…

2024 October-November · Paper 22 · Q2(b)(i)

Structured programming · 2 marks · official answer ready

(i) Write pseudocode to declare the array. ........................................................................................................................................…

2024 October-November · Paper 22 · Q2(b)(ii)

Structured programming · 1 mark · official answer ready

(ii) The new procedure Conceal() will write the modified string to the corresponding element in column two. The array CardNumber is passed as a parameter to the new procedure Conc…

2024 October-November · Paper 22 · Q5(a)

Constructs · 3 marks · official answer ready

(a) Run-time errors can be generated in different ways. For example, a run-time error will be generated if a function is called with invalid parameters. The pseudocode contains th…

2024 October-November · Paper 22 · Q5(c)

Constructs · 2 marks · official answer ready

(c) The function Process() contains a selection construct using a CASE structure. Write pseudocode using a single selection construct with the same functionality without using a C…

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

Constructs · 7 marks · official answer ready

1 (a) The following table contains pseudocode examples. Each example may contain statements that relate to one or more of the following: • selection • iteration (repetition) • sub…

2024 October-November · Paper 23 · Q2(b)

Constructs · 2 marks · official answer ready

(b) The algorithm requires the use of basic constructs. One of these is sequence. Identify one other basic construct required by the algorithm and describe how it is used. Constru…

2024 October-November · Paper 23 · Q5(b)(i)

Constructs · 2 marks

(i) The mark for a given paper is stored in variable Mark. Describe how an algorithm would use the Check array to determine whether this paper should be checked. .................…

2024 October-November · Paper 23 · Q6

Structured programming · 7 marks · official answer ready

6 In some countries, on the third Sunday in March, daylight saving time begins when clocks move forward by one hour. A module AdjustClock() will take an integer parameter represen…

2024 October-November · Paper 23 · Q8(c)

Constructs · 2 marks · official answer ready

(c) The game can last for several days and users often find that they have to close and rerun the game program many times in order to complete it. Describe the benefit of using th…

2024 October-November · Paper 31 · Q7(a)

Programming basics · 3 marks · official answer ready

7 The truth table for a logic circuit is shown. INPUT OUTPUT A B C D T 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 1 1 0 1 0 …

2024 October-November · Paper 31 · Q7(c)

Programming basics · 2 marks · official answer ready

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

2024 October-November · Paper 32 · Q6(c)

Programming basics · 2 marks · official answer ready

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

2024 October-November · Paper 33 · Q7(a)

Programming basics · 3 marks · official answer ready

7 The truth table for a logic circuit is shown. INPUT OUTPUT A B C D T 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 1 1 0 1 0 …