Programming
258 questions. Open a question to solve it and check the official answer.
Constructs · 7 marks · official answer ready
6 (a) The factorial of an integer number is the product of all the integers from that number down to 1. In general, the factorial of n is n × (n−1) × ... × 2 × 1 For example, the …
Programming basics · 4 marks · official answer ready
(b) A program is written to allow a user to input a sequence of values to be checked using the function FindBaseNumber(). The user will input one value at a time. The variable use…
Constructs · 1 mark
(iii) Write the declaration for the single array in pseudocode. ...................................................................................................................…
Programming basics · 1 mark · official answer ready
(ii) Test your program using the number 61 as input. Take a screenshot to show the output. Copy and paste the screenshot into part 1(d)(ii) in the evidence document. [1]
Constructs · 1 mark · official answer ready
(ii) Test your program. Take a screenshot to show the output. Copy and paste the screenshot into part 3(e)(ii) in the evidence document. [1] 12 reasonable effort has been made by …
Constructs · 2 marks · official answer ready
(c) Francis is part of a team writing a program. He finds an error in part of the program that has already been tested. He decides not to tell anyone because he is worried about t…
Constructs · 4 marks · official answer ready
(c) The school has several laptops. Each laptop has a Wireless Network Interface Card (WNIC). Describe the functions of a Wireless Network Interface Card. ........................…
Constructs · 2 marks · official answer ready
(c) Francis is part of a team writing a program. He finds an error in part of the program that has already been tested. He decides not to tell anyone because he is worried about t…
Constructs · 4 marks · official answer ready
(c) The school has several laptops. Each laptop has a Wireless Network Interface Card (WNIC). Describe the functions of a Wireless Network Interface Card. ........................…
Constructs · 7 marks · official answer ready
5 [4] (b) A program module controls the heaters. This module operates as follows: • If the temperature is below 10, switch the heaters on. • If the temperature is above 20, switch…
Structured programming · 11 marks · official answer ready
5 [4] (c) A function LogEvents() will: • take a Student ID as a parameter • for each element in the array that matches the Student ID parameter: ◦ add the value of the array eleme…
Constructs · 8 marks · official answer ready
(b) The module description of SearchInRow() is provided here for reference. Module Description • Takes two parameters of type INTEGER: ◦ a row number ◦ a start column (1 or 1280) …
Programming basics · 11 marks · official answer ready
2 (a) An algorithm will: 1. input an integer value 2. jump to step 6 if the value is zero 3. sum and count the positive values 4. sum and count the negative values 5. repeat from …
Constructs · 8 marks · official answer ready
(i) Identify a life cycle method that would be appropriate in this case. Give a reason for your choice. Life cycle method .........................................................…
Programming basics · 7 marks · official answer ready
(b) A procedure GetIDs() will: • prompt and input the number of a club • output the StudentID of all the students who are members of that club • output a count of all students in …
Constructs · 6 marks · official answer ready
(d) An additional module GetCentre() is defined as follows: Module Description • Calculates the coordinates of the centre point • Uses the four modules: FirstRowSet(), LastRowSet(…
Programming basics · 3 marks · official answer ready
7 (a) Write the Boolean expression that corresponds to the given truth table as a sum-of-products. INPUT OUTPUT A B C D Z 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1…
Constructs · 10 marks · official answer ready
(a) The 2D array, ArrayNodes, is declared with space for 20 nodes. Each node has a left pointer, data and right pointer. The program also initialises the: • RootPointer to -1 (nul…
Constructs · 2 marks
4 Take a screenshot to show the output after the given data are entered. Copy and paste the screenshot into part 3(d)(ii) in the evidence document. [1] 11 (e) An in-order tree tra…
Programming basics · 1 mark · official answer ready
(a) INPUT x IF x < 0 OR x > 10 THEN OUTPUT "Invalid" ENDIF ........................................................................................................................…
