Computing 9691 · 11

11.3 Structured programming

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

Reset
2016 May-June · Paper 22 · Q3(b)(iii)

Structured programming · 3 marks · official answer ready

(iii) The procedure CheckForStartOfWord(Puzzle, ThisRow, ThisColumn, Across, Down) has five parameters. Parameters can be passed by reference or by value. For each parameter, tick…

2014 October-November · Paper 12 · Q5(e)

Structured programming · 2 marks · official answer ready

(e) The microprocessor contains both RAM and ROM. Give one function of each type of memory in the alarm clock. RAM ................................................................…

2014 October-November · Paper 21 · Q4(a)

Structured programming · 28 marks

(a) The program calls the function PasswordCheck with the stored password as parameter. If the user enters the correct password the function returns the value TRUE. Each time the …

2014 October-November · Paper 22 · Q3(c)(ii)

Structured programming · 9 marks

(ii) Nathan wants to test the validation of the parameter, x, by this function. Give three different types of test data with an example of each. Justify your choices. Type of test…

2014 October-November · Paper 23 · Q4(a)

Structured programming · 28 marks

(a) The program calls the function PasswordCheck with the stored password as parameter. If the user enters the correct password the function returns the value TRUE. Each time the …

2014 October-November · Paper 32 · Q1(c)(ii)

Structured programming · 1 mark · official answer ready

(ii) Give one further use of a stack data structure by a computer system. .........................................................................................................…

2014 May-June · Paper 23 · Q1(c)

Structured programming · 1 mark · official answer ready

(c) Sheena could have written the algorithm in part (a)(ii) as a procedure. What is the difference between a function and a procedure? [1] 4

2013 May-June · Paper 21 · Q3(c)

Structured programming · 1 mark · official answer ready

(c) Good programming practice uses local variables. What is the scope of a local variable? [1] To make future computation more straightforward Meena retrieves her marks from the f…

2013 May-June · Paper 21 · Q3(g)(i)

Structured programming · 1 mark · official answer ready

(i) State the difference between a procedure and a function. [1]

2013 May-June · Paper 21 · Q3(g)(ii)

Structured programming · 1 mark · official answer ready

(ii) State why the sub-routine to calculate the average mark could be written as a function. [1] 13

2013 May-June · Paper 21 · Q3(h)(i)

Structured programming · 1 mark · official answer ready

(i) What is returned by INT(34.2)? [1] AvMark may be a decimal number such as 79.7 or 34.2. Meena wants the answer rounded to the nearest whole number. A variable, Rounded, is ass…

2013 May-June · Paper 21 · Q3(h)(iii)

Structured programming · 4 marks · official answer ready

(iii) Write program code for a function CalculateRounded which returns the rounded average mark. Programming language Code [4] 14

2013 May-June · Paper 22 · Q3(c)

Structured programming · 1 mark · official answer ready

(c) Good programming practice uses local variables. What is the scope of a local variable? [1] To make future computation more straightforward Meena retrieves her marks from the f…

2013 May-June · Paper 22 · Q3(g)(i)

Structured programming · 1 mark · official answer ready

(i) State the difference between a procedure and a function. [1]

2013 May-June · Paper 22 · Q3(g)(ii)

Structured programming · 1 mark · official answer ready

(ii) State why the sub-routine to calculate the average mark could be written as a function. [1] 13

2013 May-June · Paper 22 · Q3(h)(i)

Structured programming · 1 mark · official answer ready

(i) What is returned by INT(34.2)? [1] AvMark may be a decimal number such as 79.7 or 34.2. Meena wants the answer rounded to the nearest whole number. A variable, Rounded, is ass…

2013 May-June · Paper 22 · Q3(h)(iii)

Structured programming · 4 marks · official answer ready

(iii) Write program code for a function CalculateRounded which returns the rounded average mark. Programming language Code [4] 14

2013 May-June · Paper 23 · Q3(f)

Structured programming · 1 mark · official answer ready

(f) MyAvMark is a variable of data type REAL. Meena wants the value of MyAvMark converted to the nearest whole number. State a function that will perform the conversion. [1] 9 The…

2013 May-June · Paper 23 · Q3(g)(i)

Structured programming · 1 mark · official answer ready

(i) State one difference between a procedure and a function. [1]

2013 May-June · Paper 23 · Q3(g)(ii)

Structured programming · 2 marks · official answer ready

(ii) State why the module to calculate the average mark could be written as a procedure or a function. [2] 10