Further programming
152 questions. Open a question to solve it and check the official answer.
Programming paradigms · 1 mark
(i) Identify the object-oriented programming (OOP) term described as ‘an occurrence of an object’. ................................................................................…
Programming paradigms · 2 marks · official answer ready
(ii) Describe what is meant by the OOP term polymorphism. .........................................................................................................................…
Programming paradigms · 4 marks · official answer ready
5 Complete the table by filling in the missing object-oriented programming (OOP) terms and descriptions. OOP term Description A method that accesses the value of a property. .....…
Programming paradigms · 3 marks · official answer ready
(ii) Write program code for the three get methods. Save your program. Copy and paste the program code into part 3(a)(ii) in the evidence document. [3]
Programming paradigms · 3 marks · official answer ready
(iii) The method SetLeft() takes an object of type Node as a parameter. The method stores the parameter in the attribute LeftNode The method SetRight() takes an object of type Nod…
Programming paradigms · 2 marks · official answer ready
(b) Write the main program to declare five objects of type Node : • Node 1 with the data 10 • Node 2 with the data 20 • Node 3 with the data 5 • Node 4 with the data 15 • Node 5 w…
Programming paradigms · 2 marks · official answer ready
(i) Write program code to declare the class Tree and its constructor. Do not declare the other methods. Use your programming language appropriate constructor. If you are writing i…
Programming paradigms · 1 mark · official answer ready
(ii) Write program code for GetRootNode() Save your program. Copy and paste the program code into part 3(c)(ii) in the evidence document. [1]
Programming paradigms · 3 marks · official answer ready
(i) Write program code to extend the main program to: • create a new object of type Tree with the node containing the data 10 as the first node • insert the nodes with the values …
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class Animal and its constructor. Do not declare the other methods. Use your programming language appropriate constructor. If you are writing…
Programming paradigms · 3 marks · official answer ready
(ii) The method Description() creates and returns a string of the animal’s data in the format: "The animal's name is " ", it makes a " ", its size is " " and its intelligence leve…
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class Parrot, its constructor and the method ChangeNumberWords() Use your programming language appropriate constructor. If you are writing in…
Programming paradigms · 2 marks · official answer ready
(ii) The method Description() in the class Parrot creates and returns a string of the animal’s data in the format: "The animal's name is " ", it makes a " ", its size is " " and i…
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class Wolf, its constructor and the method SetTerritorySize() Use your programming language appropriate constructor. If you are writing in Py…
Programming paradigms · 2 marks · official answer ready
(ii) The method Description() in the class Wolf creates and returns a string of the animal’s data in the format: "The animal's name is " ", it makes a " ", its size is " " and its…
Programming paradigms · 2 marks · official answer ready
(i) The main program declares instances of the classes for three animals: • A parrot with the name ‘Chewie’; it makes a ‘Squawk’ sound. Its size is 1, intelligence is 10, wingspan…
Programming paradigms · 3 marks · official answer ready
(ii) The main program also needs to: • decrease the territory for the wolf Nighteyes by 20 square miles • increase the number of words the parrot Chewie can say by 2 words • outpu…
Programming paradigms · 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…
Programming paradigms · 3 marks · official answer ready
(ii) Write program code for the two get methods. Save your program. Copy and paste the program code into part 3(a)(ii) in the evidence document. [3]
Programming paradigms · 2 marks · official answer ready
(iii) The method SetNextNode() takes an object of type Node as a parameter. The method stores the parameter in the attribute NextNode Write program code for SetNextNode() Save you…
