3.2 Logic gates and logic circuits
25 questions in this subtopic. Open a question to solve it and check the official answer.
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…
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…
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()…
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…
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…
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…
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…
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 …
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…
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. …
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]
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
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]
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…
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…
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 …
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…
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. …
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]
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
