Programming
258 questions. Open a question to solve it and check the official answer.
Constructs · 1 mark · official answer ready
(b) State why a 3D printer needs a buffer. ........................................................................................................................................…
Constructs · 2 marks · official answer ready
(i) Give two benefits of storing data using cloud computing. 1 ....................................................................................................................…
Constructs · 3 marks · official answer ready
(d) Memory management is one key management task performed by an OS. Give three other key management tasks that are performed by an OS. 1 .........................................…
Programming basics · 5 marks · official answer ready
(a) One part of the program contains an algorithm which is represented by a state-transition diagram. The table shows the inputs, outputs and states for the algorithm: Current sta…
Constructs · 4 marks · official answer ready
1 (a) The table contains pseudocode examples. Each example may contain statements that relate to one or more of: • selection • iteration (repetition) • subroutines (procedures or …
Constructs · 2 marks · official answer ready
(d) It is decided to extend the program so that a new module Reminder() will send an email to the student three days before the book is due to be returned. Outline the changes tha…
Structured programming · 2 marks · official answer ready
(a) A function Generate() is written to take an original number as a parameter and to return the check digit. Outline a test plan that could be used to fully test function Generat…
Programming basics · 5 marks · official answer ready
(a) One part of the program contains an algorithm which is represented by a state-transition diagram. The table shows the inputs, outputs and states for the algorithm: Current sta…
Constructs · 2 marks · official answer ready
(iii) One way of storing the data items in a text file is to store each data item on a separate line. Identify one benefit and one drawback of this way of storing the data. Benefi…
Constructs · 5 marks · official answer ready
(i) Complete the pseudocode for the function to remove a data item from the stack. FUNCTION Pop() .................................................................................…
Constructs · 1 mark · official answer ready
(b) The address 632 contains the value 45. State the value of Answer after the code described in part (a) has executed. ...........................................................…
Constructs · 4 marks · official answer ready
(i) Complete the pseudocode for the procedure to add a data item onto the stack. PROCEDURE Push(...................................................................................…
Programming basics · 2 marks · official answer ready
(ii) Write pseudocode to input a new data item and add it to the stack using Push(). ..............................................................................................…
Constructs · 4 marks · official answer ready
(c) The function Pop() returns the next integer in the stack and updates the pointer as appropriate. If there is no data in the stack, the function returns the value –999 Write pr…
Constructs · 4 marks · official answer ready
(d) The main program generates 40 random integers between 0 and 1000 (inclusive) and attempts to insert each one into the stack using the appropriate function. If the return value…
Constructs · 4 marks · official answer ready
(e) The procedure FindValues(): • pops each integer from the stack until the stack is empty • finds and outputs the largest number that was in the stack in an appropriate message …
Structured programming · 3 marks · official answer ready
(b) The procedure PrintArray() takes an integer array as a parameter. The procedure outputs the array contents on a single line with a space between each integer. Write the progra…
Constructs · 5 marks · official answer ready
(c) The function BubbleSort(): • takes an integer array as a parameter • sorts the data into ascending order using a bubble sort • returns the sorted array. The function needs to …
Constructs · 1 mark · official answer ready
(ii) Test your program. Take a screenshot that shows all of the content stored in the file Tree.txt In this screenshot you need to make sure the filename is visible. Save your pro…
Structured programming · 5 marks · official answer ready
2 A program reads string data from a text file into a linear queue and then compresses the data. The queue is created using the global 1D array Queue. The queue can store up to 10…
