Further programming
152 questions. Open a question to solve it and check the official answer.
Programming paradigms · 2 marks · official answer ready
(iii) Test your program with the following input data for four fences: Height Risk 152 5 121 1 130 3 145 4 Take a screenshot of the output. Save your program. Copy and paste the s…
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 the appropriate constructor for your programming language. If you are w…
Programming paradigms · 3 marks · official answer ready
(ii) The get methods GetLeft(), GetRight()and GetData()each return the relevant attribute. Write program code for the three get methods. Save your program. Copy and paste the prog…
Programming paradigms · 3 marks · official answer ready
(iii) The set methods SetLeft(), SetRight()and SetData()each take a parameter and then store this in the relevant attribute. Write program code for the three set methods. Save you…
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class TreeClass and its constructor. Do not declare the other methods. Use the appropriate constructor for your programming language. If you …
Programming paradigms · 1 mark · official answer ready
(i) The main program declares an instance of TreeClass with the identifier TheTree. Write program code for the main program. Save your program. Copy and paste the program code int…
Programming paradigms · 4 marks · official answer ready
(ii) The main program inserts the following integers into the binary tree in the order given: 10 11 5 1 20 7 15 The main program then calls the method OutputTree(). Write program …
Programming paradigms · 1 mark · official answer ready
(iii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 2(c)(iii) in the evidence document. [1] 10
Programming paradigms · 4 marks · official answer ready
(i) Write program code to declare the class Character and its constructor. Do not declare the other methods. Use your programming language’s appropriate constructor. If you are wr…
Programming paradigms · 3 marks · official answer ready
(ii) The get methods GetXPosition() and GetYPosition() each return the relevant attribute. Write program code for the get methods. Save your program. Copy and paste the program co…
Programming paradigms · 4 marks · official answer ready
(iii) The set methods SetXPosition() and SetYPosition() each take a value as a parameter and add this to the current X or Y position. If the new value exceeds 10 000, it is limite…
Programming paradigms · 4 marks · official answer ready
(iv) The method Move() takes a string parameter: "up", "down", "left" or "right". The table shows the change each direction will make to the X or Y position. Use the appropriate m…
Programming paradigms · 2 marks · official answer ready
(b) Write program code to declare a new instance of Character with the identifier Jack. The starting X position is 50 and the starting Y position is 50, the character’s name is Ja…
Programming paradigms · 3 marks · official answer ready
(i) Write program code to declare the class BikeCharacter and its constructor. Do not declare the other method. Use your programming language’s appropriate constructor. If you are…
Programming paradigms · 2 marks · official answer ready
(ii) The method Move() overrides the method from the parent class. The table shows the change each direction will make to the X or Y position. Direction Value change up Y position…
Programming paradigms · 1 mark · official answer ready
(d) Write program code to declare a new instance of BikeCharacter with the identifier Karla. The starting X position is 100, the starting Y position is 50 and the character’s name…
Programming paradigms · 5 marks · official answer ready
(i) Write program code to: • take as input which of the two characters the user would like to move • take as input the direction the user would like the character to move • call t…
Programming paradigms · 2 marks · official answer ready
(ii) Test your program twice with the following inputs. Test 1: jack right Test 2: karla down Take a screenshot of the output. Save your program. Copy and paste the screenshot int…
Programming paradigms · 4 marks · official answer ready
4 Draw one line from each Object‑Oriented Programming (OOP) term to its most appropriate description. OOP term Description methods used to return the value of a property Encapsula…
File processing and exception handling · 4 marks · official answer ready
(ii) Amend the main program to read the contents of Data.txt into DataArray Save your program. Copy and paste the program code into part 1(a)(ii) in the evidence document. [4]
