Programming
471 questions. Open a question to solve it and check the official answer.
Constructs · 4 marks · official answer ready
(ii) Describe in detail the purpose of lines 19 to 26 in the function ScanArray(). Do not use pseudocode in your answer. ..........................................................…
Constructs · 6 marks · official answer ready
(b) The function ScanArray() needs to be amended so that the comparison is not case sensitive. For example, comparing “Aaaa” with “AAAa” should evaluate to TRUE. Write program cod…
Constructs · 6 marks
1 (a) The following table contains statements written in pseudocode. Show the type of programming construct each statement represents. Put a tick (3) in the appropriate column for…
Programming basics · 2 marks · official answer ready
3 (a) Programming is sometimes referred to as a transferable skill. You are asked to work on a program written in a language you are not familiar with. Explain how transferable sk…
Structured programming · 5 marks · official answer ready
(i) Examine the pseudocode. Complete the following table. Answer The identifier name of a local variable The identifier name of a user-defined procedure The identifier name of a u…
Structured programming · 1 mark · official answer ready
(i) State how structured programming languages support the implementation of sub-tasks. ...........................................................................................…
Constructs · 3 marks · official answer ready
(d) ResultArray is a 1D array of type STRING. It contains 100 elements. Write program code to declare ResultArray and set all elements to the value "NO DATA". Programming language…
Constructs · 6 marks
1 (a) The following table contains statements written in pseudocode. Show the type of programming construct each statement represents. Put a tick (3) in the appropriate column for…
Constructs · 5 marks · official answer ready
(ii) The following table contains statements written in pseudocode. Complete the table by evaluating each expression using the values from part (b)(i). If any expression is invali…
Structured programming · 8 marks · official answer ready
(b) Line 118 of the function Update() calls the subroutine Insert(). A designer decides to convert Insert() from a procedure to a function. Insert() returns TRUE or FALSE. A progr…
Programming basics · 1 mark · official answer ready
(ii) A programmer decides to declare LastElement as a constant instead of a variable. Write a statement in pseudocode to declare LastElement as the value 200. ....................…
Programming basics · 3 marks · official answer ready
(iii) The K‑map can be used to simplify the expression in part (a)(i). Draw loop(s) around appropriate groups of 1s in the table in part (a)(ii) to produce an optimal sum‑of‑produ…
Programming basics · 3 marks · official answer ready
(iv) Write the simplified sum‑of‑products expression for your answer to part (a)(iii). X = ........................................................................................…
Programming basics · 2 marks · official answer ready
(ii) Draw loop(s) around appropriate groups of 1s in the table in part (b)(i) to produce an optimal sum‑of‑products. [2]
Programming basics · 2 marks · official answer ready
(iii) Write the simplified sum‑of‑products expression for your answer to part (b)(ii). X = ........................................................................................…
Programming basics · 3 marks · official answer ready
(a) Complete the symbol table to show its contents after the lexical analysis stage. Token Symbol Value Type Start 60 Variable 1 61 Constant [3]
Programming basics · 2 marks · official answer ready
(ii) Draw loops around appropriate groups of 1s in the table in part (c)(i) to produce an optimal sum-of-products. [2]
Programming basics · 2 marks · official answer ready
(iii) Using your answer to part (c)(ii), write a simplified sum-of-products Boolean expression. X = ...............................................................................…
Programming basics · 3 marks · official answer ready
(a) Complete the symbol table to show its contents after the lexical analysis stage. Token Symbol Value Type Number1 60 Variable Number2 61 Variable [3] 9
Programming basics · 3 marks · official answer ready
(iii) The K‑map can be used to simplify the expression in part (a)(i). Draw loop(s) around appropriate groups of 1s in the table in part (a)(ii) to produce an optimal sum‑of‑produ…
