Programming
258 questions. Open a question to solve it and check the official answer.
Constructs · 3 marks · official answer ready
(ii) Describe the benefits of your answer to part (b)(i) with reference to this program. ..........................................................................................…
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]
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. ................................................................…
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…
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…
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…
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…
Structured programming · 2 marks · official answer ready
(i) Write pseudocode to declare the array. ........................................................................................................................................…
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…
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…
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…
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…
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…
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. .................…
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…
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…
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 …
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]
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]
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 …
