11.3 Structured programming
15 questions in this subtopic. Open a question to solve it and check the official answer.
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…
Structured programming · 1 mark · official answer ready
(i) State the difference between a procedure and a function. [1]
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
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…
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
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…
Structured programming · 1 mark · official answer ready
(i) State the difference between a procedure and a function. [1]
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
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…
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
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…
Structured programming · 1 mark · official answer ready
(i) State one difference between a procedure and a function. [1]
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
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]
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]
