Computer Science For First Examination In 2021 9618 · 3

Hardware

25 questions. Open a question to solve it and check the official answer.

Reset
2025 May-June · Paper 41 · Q3(a)(i)

Logic gates and logic circuits · 4 marks · official answer ready

(i) Write program code to declare the class Node and its constructor. Do not declare the other methods. Use your programming language appropriate constructor. If you are writing i…

2025 May-June · Paper 43 · Q3(b)(iv)

Logic gates and logic circuits · 6 marks · official answer ready

(iv) The method RemoveNode() takes an integer parameter to search for and remove from the linked list. The method first checks if the linked list is empty. If the linked list is e…

2025 May-June · Paper 43 · Q4(b)(iv)

Logic gates and logic circuits · 12 marks

4 56 67 44 43 32 31 345 45 6 54 1 Save your program as Question2_J25. Copy and paste the program code into part 2(a) in the evidence document. [1] (b) The function InsertionSort()…

2024 October-November · Paper 42 · Q2(a)

Logic gates and logic circuits · 3 marks · official answer ready

(a) Write program code to declare the record structure Queue and its fields. If your programming language does not support record structures, a class can be declared instead. If y…

2024 May-June · Paper 21 · Q1(a)

Logic gates and logic circuits · 4 marks · official answer ready

(a) The following table shows four valid pseudocode assignment statements. Complete the table by giving an appropriate data type to declare each of the variables A, B, C and D. As…

2024 May-June · Paper 21 · Q1(b)

Logic gates and logic circuits · 4 marks · official answer ready

(b) Other variables in the program have example values as shown: Variable Value Sorted False Tries 9 ID "ZGAC001" Complete the table by evaluating each expression, using the examp…

2024 May-June · Paper 41 · Q4(a)(i)

Logic gates and logic circuits · 16 marks

(i) Write program code to declare the class Tree and its constructor. Do not declare the other methods. Use the appropriate constructor for your programming language. All attribut…

2024 May-June · Paper 41 · Q4(a)(ii)

Logic gates and logic circuits · 15 marks

(ii) The get methods GetTreeName(), GetGrowth(), GetMaxHeight(), GetMaxWidth() and GetEvergreen() each return the relevant attribute. Write program code for the get methods. Save …

2024 May-June · Paper 41 · Q4(b)

Logic gates and logic circuits · 19 marks

(b) The text file Trees.txt stores data about 9 trees. The data in the file is stored in the format: Tree name,Height growth each year,Maximum height,Maximum width,Evergreen For e…

2024 May-June · Paper 41 · Q4(c)

Logic gates and logic circuits · 16 marks

(c) The procedure PrintTrees() takes a Tree object as a parameter and outputs the tree’s name, height growth each year, maximum height, maximum width and whether it is evergreen. …

2024 May-June · Paper 41 · Q4(d)(i)

Logic gates and logic circuits · 14 marks

(i) Write program code for the main program. Save your program. Copy and paste the program code into part 2(d)(i) in the evidence document. [2]

2024 May-June · Paper 41 · Q4(d)(ii)

Logic gates and logic circuits · 13 marks

(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 2(d)(ii) in the evidence document. [1] 9

2024 May-June · Paper 41 · Q4(e)(i)

Logic gates and logic circuits · 18 marks

(i) Write program code for ChooseTree(). Save your program. Copy and paste the program code into part 2(e)(i) in the evidence document. [6]

2024 May-June · Paper 42 · Q2(b)(ii)

Logic gates and logic circuits · 6 marks · official answer ready

(ii) The method InsertNode()takes a Node object, NewNode, as a parameter and inserts it into the array Tree. InsertNode()first checks if the tree is empty. If the tree is empty, I…

2024 May-June · Paper 43 · Q4(a)(i)

Logic gates and logic circuits · 16 marks

(i) Write program code to declare the class Tree and its constructor. Do not declare the other methods. Use the appropriate constructor for your programming language. All attribut…

2024 May-June · Paper 43 · Q4(a)(ii)

Logic gates and logic circuits · 15 marks

(ii) The get methods GetTreeName(), GetGrowth(), GetMaxHeight(), GetMaxWidth() and GetEvergreen() each return the relevant attribute. Write program code for the get methods. Save …

2024 May-June · Paper 43 · Q4(b)

Logic gates and logic circuits · 19 marks

(b) The text file Trees.txt stores data about 9 trees. The data in the file is stored in the format: Tree name,Height growth each year,Maximum height,Maximum width,Evergreen For e…

2024 May-June · Paper 43 · Q4(c)

Logic gates and logic circuits · 16 marks

(c) The procedure PrintTrees() takes a Tree object as a parameter and outputs the tree’s name, height growth each year, maximum height, maximum width and whether it is evergreen. …

2024 May-June · Paper 43 · Q4(d)(i)

Logic gates and logic circuits · 14 marks

(i) Write program code for the main program. Save your program. Copy and paste the program code into part 2(d)(i) in the evidence document. [2]

2024 May-June · Paper 43 · Q4(d)(ii)

Logic gates and logic circuits · 13 marks

(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 2(d)(ii) in the evidence document. [1] 9