9.2 Algorithms
47 questions in this subtopic. Open a question to solve it and check the official answer.
Algorithms · 5 marks · official answer ready
(b) Draw a program flowchart to represent the pseudocode algorithm. Variable declarations are not required in program flowcharts. [5] 6
Algorithms · 4 marks · official answer ready
(b) Result is a 1D array of type STRING. It contains 100 elements. Draw a program flowchart for an algorithm that will output each element in the array. [4] 6
Algorithms · 6 marks · official answer ready
(c) The program flowchart for part of an algorithm from a mobile phone program is shown. Identifier Active is a global variable of type BOOLEAN. START Set Online to FALSE Is Onlin…
Algorithms · 2 marks · official answer ready
(c) A dry run of a pseudocode algorithm may help to locate logic errors. Give another type of program error and describe how it can occur. Type of error ..........................…
Algorithms · 5 marks · official answer ready
(ii) Draw a program flowchart to represent the algorithm implemented in the pseudocode. Variable declarations are not required in program flowcharts. [5] 4
Algorithms · 5 marks · official answer ready
(ii) Draw a program flowchart to represent the algorithm implemented in the pseudocode. Variable declarations are not required in program flowcharts. [5] 4
Algorithms · 4 marks · official answer ready
(ii) Part of a program flowchart is shown. LOOP AlarmReset() Set Status1 to GetStatus(Sys_A) Set Status2 to GetStatus(Sys_B) Are Status1 NO and Status2 both TRUE? YES Implement th…
Algorithms · 4 marks · official answer ready
(i) Algorithms may be expressed using four basic constructs. One construct is sequence. Complete the following table for two other constructs. Construct Pseudocode example .......…
Algorithms · 4 marks · official answer ready
(ii) Simple algorithms usually consist of input, process and output. Complete the table by placing ticks (‘3’) in the relevant boxes. Pseudocode statement Input Process Output Tem…
Algorithms · 2 marks · official answer ready
(i) Explain the term algorithm. ........................................................................................................................................... .......…
Algorithms · 5 marks · official answer ready
(ii) Algorithms usually consist of three different types of activity. Complete the table below. The third activity type is given. Activity type Pseudocode example ................…
Algorithms · 1 mark · official answer ready
(ii) State the name of one other sorting algorithm. ...............................................................................................................................…
Algorithms · 4 marks · official answer ready
(i) There are four errors in the algorithm. Write the line of code where an error is present and write the correction in pseudocode. Error 1 ......................................…
Algorithms · 1 mark · official answer ready
(ii) A binary search is one algorithm that can be used to search an array. Identify another searching algorithm. ..................................................................…
Algorithms · 1 mark · official answer ready
(ii) State the name of one other sorting algorithm. ...............................................................................................................................…
Algorithms · 8 marks · official answer ready
(a) Write pseudocode to implement the GetDiscountRate() function. Your solution should follow the flowchart for the function as closely as possible. Variable declarations should b…
Algorithms · 7 marks · official answer ready
(i) Write pseudocode for the CalcPoints() function. Your solution should follow the flowchart as closely as possible. .............................................................…
Algorithms · 5 marks · official answer ready
(i) Write pseudocode for the CalcBonus() function. Your solution should follow the flowchart for the function as closely as possible. .............................................…
Algorithms · 7 marks · official answer ready
(a) Write pseudocode to complete the bubble sort algorithm shown. 01 FOR Outer ..................................................................................... TO 0 STEP - 1 …
Algorithms · 4 marks · official answer ready
(c) Use pseudocode to write an alternative version of this bubble sort algorithm that will exit the algorithm when the list is fully sorted. ......................................…
