11.3 Structured programming
59 questions in this subtopic. Open a question to solve it and check the official answer.
Structured programming · 6 marks · official answer ready
2 Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 1(c)(ii) in the evidence document. [2] (d) The procedure BubbleSort() uses a bubbl…
Structured programming · 31 marks
(iii) Write program code to amend the main program to call ChooseTrees(). Test your program with the following tree requirements: • a maximum height of 400 cm • a maximum width of…
Structured programming · 7 marks · official answer ready
(a) A new procedure MyOutput() will take a string and a Boolean parameter. MyOutput() may be called repeatedly and will use concatenation to build a string using a global variable…
Structured programming · 58 marks
(ii) The design is modified and Sub-9() is changed to a procedure. The procedure will be called with a single parameter of type MyType. Write the pseudocode header for procedure S…
Structured programming · 2 marks · official answer ready
(ii) Write program code to call the function IterativeVowels() with the parameter "house" from the main program. Output the return value. Save your program. Copy and paste the pro…
Structured programming · 1 mark · official answer ready
(ii) Write program code to call the function RecursiveVowels() with the parameter "imagine" from the main program. Output the return value. Save your program. Copy and paste the p…
Structured programming · 3 marks
(a) Explain why the program gives unexpected results. .............................................................................................................................…
Structured programming · 3 marks
(c) Describe how a typical Integrated Development Environment (IDE) could be used to identify this error. .........................................................................…
Structured programming · 7 marks
11 Num 1.0 ... 40 REPEAT 41 CALL DisplaySqrt(Num) 42 Num Num + 1.0 43 UNTIL Num > 10 ... 50 PROCEDURE DisplaySqrt(BYREF ThisNum : REAL) 51 OUTPUT ThisNum 52 ThisNum SQRT(ThisNum) …
Structured programming · 2 marks · official answer ready
(i) Two of the parameter values can be checked without reference to the third parameter. Describe these two checks. Check 1 .......................................................…
Structured programming · 2 marks · official answer ready
(ii) Several values of the parameter representing the day can only be checked completely by referring to the value of one other parameter. Describe this check. ...................…
Structured programming · 7 marks · official answer ready
(a) Write pseudocode for procedure Select(). Parameter validation is not required. ................................................................................................…
Structured programming · 3 marks · official answer ready
(i) The procedure PrintArray() takes an integer array as a parameter and outputs the contents of the array in the order they are stored. The items are printed on the same line, fo…
Structured programming · 1 mark · official answer ready
(ii) Amend the main program to output the contents of DataArray using the procedure PrintArray() Save your program. Copy and paste the program code into part 1(b)(ii) in the evide…
Structured programming · 3 marks · official answer ready
(ii) Study the pseudocode function PopAnimal(): FUNCTION PopAnimal() RETURNS STRING DECLARE ReturnData : STRING IF AnimalTopPointer = 0 THEN RETURN "" ELSE ReturnData Animal[Anima…
Structured programming · 3 marks · official answer ready
(i) The procedure PrintArray() takes an integer array as a parameter and outputs the contents of the array in the order they are stored. The items are printed on the same line, fo…
Structured programming · 1 mark · official answer ready
(ii) Amend the main program to output the contents of DataArray using the procedure PrintArray() Save your program. Copy and paste the program code into part 1(b)(ii) in the evide…
Structured programming · 3 marks · official answer ready
(ii) Study the pseudocode function PopAnimal(): FUNCTION PopAnimal() RETURNS STRING DECLARE ReturnData : STRING IF AnimalTopPointer = 0 THEN RETURN "" ELSE ReturnData Animal[Anima…
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…
