Computing 9691 · 11

11.3 Structured programming

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

Reset
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

2013 May-June · Paper 31 · Q7(b)(ii)

Structured programming · 2 marks · official answer ready

(ii) Use the following numbers to label your function header above. 1. Function parameter(s) 2. Where the return data type is stated [2]

2013 May-June · Paper 32 · Q7(b)(ii)

Structured programming · 2 marks · official answer ready

(ii) Use the following numbers to label your function header above. 1. Function parameter(s) 2. Where the return data type is stated [2]