Programming
258 questions. Open a question to solve it and check the official answer.
Programming basics · 2 marks · official answer ready
(c) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal sum-of-products. [2]
Structured programming · 3 marks · official answer ready
(ii) The main program: • calls ReadData() and stores the returned array • calls FormatArray() with the returned array and outputs the returned string. Write program code for the m…
Structured programming · 1 mark · official answer ready
(iii) Test your program. Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 1(b)(iii) in the evidence document. [1] 4
Constructs · 4 marks · official answer ready
(c) The function CompareStrings(): • takes two strings as parameters • compares each string, one character at a time, to identify which string comes first alphabetically. If the f…
Structured programming · 2 marks · official answer ready
(ii) Write program code to amend the main program to: • call Bubble() with the unsorted array as a parameter • call FormatArray() with the sorted array and output the returned str…
Structured programming · 1 mark · official answer ready
(iii) Test your program. Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 1(d)(iii) in the evidence document. [1] 6
Constructs · 2 marks · official answer ready
(i) Write program code for OutputLinkedList(). Save your program. Copy and paste the program code into part 3(c)(i) in the evidence document. [2]
Structured programming · 1 mark · official answer ready
(ii) Amend the main program to: • call RemoveData() with the parameter 5 • output the word "After" • call OutputLinkedList(). Save your program. Copy and paste the program code in…
Constructs · 1 mark · official answer ready
(iii) Test your program with both sets of given test data: Test data set 1: 5 6 8 9 5 Test data set 2: 10 7 8 5 6 Take a screenshot of each output. Save your program. Copy and pas…
Programming basics · 7 marks
3 0.8 2 0.9 1 1.0 For example: • The horse Jet has PercentageSuccess of 65 and MaxFenceHeight of 160. • A fence has a height of 140 and a risk of 3. • The height of the fence is l…
Structured programming · 6 marks
5 1 2 3 8 Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 3(c)(iii) in the evidence document. [1] 15 (d) The procedure RemoveData() rem…
Structured programming · 2 marks
5 1 2 3 8 Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 3(c)(iii) in the evidence document. [1] 15 (d) The procedure RemoveData() rem…
Constructs · 5 marks · official answer ready
(c) The pseudocode function Enqueue() inserts an integer value into the queue. The function is incomplete. There are three incomplete statements. FUNCTION Enqueue(BYREF AQueue : Q…
Programming basics · 2 marks · official answer ready
(ii) Test your program with the following inputs in the order given: Take a screenshot of the output. Save your program. Copy and paste the screenshot into part 2(e)(ii) in the ev…
Programming basics · 1 mark · official answer ready
(ii) Test your program with the following inputs in the order given: 10 9 8 7 6 5 4 3 2 1 Take a screenshot of the output. Save your program. Copy and paste the screenshot into pa…
Structured programming · 2 marks · official answer ready
(c) The procedure OutputHighScores() takes a 2D array as a parameter. It outputs each player’s ID, level and score in the order they are in the array. The outputs are in the forma…
Constructs · 5 marks
(c) The pseudocode function Enqueue() inserts an integer value into the queue. The function is incomplete. There are three incomplete statements. FUNCTION Enqueue(BYREF AQueue : Q…
Structured programming · 6 marks
7 SNQT 2 10 The function SortScores() uses a bubble sort to sort the data as described and returns the sorted array. Write program code for SortScores(). Save your program. Copy a…
Constructs · 6 marks
7 SNQT 2 10 The function SortScores() uses a bubble sort to sort the data as described and returns the sorted array. Write program code for SortScores(). Save your program. Copy a…
Structured programming · 3 marks · official answer ready
(ii) The main program: • calls ReadData() and stores the returned array • calls FormatArray() with the returned array and outputs the returned string. Write program code for the m…
