Computer Science 9608 · 11

11.3 Structured programming

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

Reset
2021 May-June · Paper 22 · Q2(a)

Structured programming · 5 marks · official answer ready

(a) Examine the pseudocode and complete the following table: Answer The identifier name of a global variable The name of the loop structure The identifier involved in a data type …

2021 May-June · Paper 22 · Q3(a)(ii)

Structured programming · 5 marks · official answer ready

(ii) The headers for three modules in a program are defined in pseudocode as follows: Pseudocode module header PROCEDURE Create(S2 : INTEGER, P3 : STRING) PROCEDURE Modify(S2 : IN…

2021 May-June · Paper 23 · Q5(a)

Structured programming · 8 marks · official answer ready

(a) Write pseudocode for a function GroupNum(), which takes a telephone number and a template as parameter strings and returns a formatted string. You may assume that the template…

2021 May-June · Paper 23 · Q5(b)

Structured programming · 4 marks · official answer ready

(b) The function GroupNum() is to be extended to include parameter checking. State one check that could be applied to each parameter. Give an example of test data that could be us…

2021 May-June · Paper 23 · Q6(b)

Structured programming · 16 marks · official answer ready

(b) Write program code for a module GroupReport(), which will summarise the stock data for a given product group. The product group will be passed to the module as a string. The t…

2021 May-June · Paper 41 · Q2(b)(iii)

Structured programming · 5 marks · official answer ready

(iii) The function, getCustomer(): • takes the customer ID as a parameter • passes the customer ID to the function getRecordLocation(), which returns the calculated hash value • r…

2021 May-June · Paper 42 · Q2(b)(i)

Structured programming · 2 marks · official answer ready

(i) The function Hash() takes the booking ID as a parameter, calculates and returns the hash value. Write program code for the function Hash(). Programming language ..............…

2021 May-June · Paper 42 · Q4(b)(i)

Structured programming · 5 marks · official answer ready

(i) The function Enqueue() takes the value to be added to the queue as a parameter. The function returns TRUE if the item was added, or FALSE if the queue is full. Complete the ps…

2021 May-June · Paper 43 · Q2(b)(iii)

Structured programming · 5 marks · official answer ready

(iii) The function, getCustomer(): • takes the customer ID as a parameter • passes the customer ID to the function getRecordLocation(), which returns the calculated hash value • r…

2019 October-November · Paper 22 · Q4(a)

Structured programming · 6 marks · official answer ready

(a) Write pseudocode for the procedure Button(). Declare any additional variables you use. The value of MaxVol should not be changed within the procedure. Parameter validation is …

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

Structured programming · 6 marks · official answer ready

(b) The procedure Button() is to be tested using black-box testing. Fill in the gaps below to define three tests that could be carried out. TEST 1 – VolLevel is changed Parameter …

2019 October-November · Paper 22 · Q4(c)(ii)

Structured programming · 3 marks · official answer ready

(ii) Stub testing is a technique often used in the development of modular programs. Describe the technique. .......................................................................…

2019 October-November · Paper 23 · Q6(a)(ii)

Structured programming · 8 marks · official answer ready

(ii) Function FindBooksBy() will: • receive the Author Name as a parameter • search Library.txt for matching entries • store the Book Title and Location of matching entries in the…

2019 May-June · Paper 21 · Q5(b)

Structured programming · 8 marks · official answer ready

(b) A student is learning about random number generation. She is investigating how many times the random function needs to be called before every number in a given series is gener…

2019 May-June · Paper 22 · Q2(a)(iii)

Structured programming · 2 marks · official answer ready

(iii) The following pseudocode uses the subroutine DoSomething(). Answer 23 + DoSomething("Yellow") State whether the subroutine is a function or a procedure. Justify your answer.…

2019 May-June · Paper 22 · Q5(b)

Structured programming · 6 marks · official answer ready

(b) A procedure, CountLines(), is being written to count the number of lines in a text file. The procedure will: • take a filename as a string parameter • count the number of line…

2019 May-June · Paper 42 · Q2(b)(iii)

Structured programming · 7 marks · official answer ready

(iii) The stack is implemented as a 1D array, with eight elements, and given the identifier ArrayStack. The global variable Top contains the index of the last element in the stack…

2018 October-November · Paper 22 · Q4(a)(i)

Structured programming · 5 marks · official answer ready

(i) Examine the pseudocode. Complete the following table. Answer The identifier name of a local variable The identifier name of a user-defined procedure The identifier name of a u…

2018 October-November · Paper 22 · Q4(c)(i)

Structured programming · 1 mark · official answer ready

(i) State how structured programming languages support the implementation of sub-tasks. ...........................................................................................…

2018 October-November · Paper 23 · Q4(b)

Structured programming · 8 marks · official answer ready

(b) Line 118 of the function Update() calls the subroutine Insert(). A designer decides to convert Insert() from a procedure to a function. Insert() returns TRUE or FALSE. A progr…