Programming
258 questions. Open a question to solve it and check the official answer.
Constructs · 3 marks · official answer ready
(b) State three benefits of using an array of records to store the data for all items. 1 ..........................................................................................…
Constructs · 7 marks · official answer ready
(a) Up to 16 characters can be displayed. Track titles longer than 16 characters will need to be trimmed as follows: • Words must be removed from the end of the track title until …
Programming basics · 1 mark · official answer ready
(ii) Identify the input sequence that will cause the minimum number of state changes in the transition from S1 to S4. .............................................................…
Constructs · 8 marks · official answer ready
(c) Two modules are defined: Module Description DeleteComment() • called with a parameter of type string representing a line of (already written) pseudocode from a student’s proje…
Structured programming · 3 marks · official answer ready
(ii) Describe how the modification would be implemented. ..........................................................................................................................…
Programming basics · 6 marks · official answer ready
(a) Write pseudocode for the procedure TwoParts(). ................................................................................................................................…
Programming basics · 2 marks · official answer ready
(i) Identify a suitable data structure that could be used to store the different total values. ....................................................................................…
Programming basics · 3 marks · official answer ready
(ii) Describe three benefits of using the data structure given in part (b)(i). 1 ..................................................................................................…
Structured programming · 2 marks · official answer ready
(i) Write pseudocode for the new module header. ...................................................................................................................................…
Programming basics · 1 mark · official answer ready
(a) The integer numbers will be stored in the global 1D array, DataStored, with space for up to 20 integers. The global variable NumberItems stores the quantity of items the array…
Programming basics · 0 marks · official answer ready
(ii) Test your program by inputting the following data in the order given: 30 5 3 9 4 1
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…
Programming basics · 14 marks
(ii) The procedure ChooseTree() needs amending. After the procedure has output the list of trees that meet all the requirements, the procedure needs to: • take as input the name o…
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 · 6 marks · official answer ready
(a) The procedure ReadWords(): • takes a file name as a parameter • opens the file and reads in the data • stores the main word in the first element in WordArray • stores each ans…
Constructs · 4 marks · official answer ready
(b) The main program asks the user to enter "easy", "medium" or "hard" and calls ReadWords()with the filename that matches the user’s input. For example, if the user enters "easy"…
Constructs · 4 marks · official answer ready
(iii) The method OutputTree()outputs the left pointer, the data and the right pointer for each node that has been inserted into the tree. The outputs are in the order they are sav…
Programming basics · 1 mark · official answer ready
(a) The integer numbers will be stored in the global 1D array, DataStored, with space for up to 20 integers. The global variable NumberItems stores the quantity of items the array…
Programming basics · 0 marks · official answer ready
(ii) Test your program by inputting the following data in the order given: 30 5 3 9 4 1
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…
