Computer Science For First Examination In 2021 9618 · 20

Further programming

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

2024 October-November · Paper 43 · Q2(e)(iii)

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…

2024 May-June · Paper 42 · Q2(a)(i)

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…

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

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…

2024 May-June · Paper 42 · Q2(a)(iii)

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…

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

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 …

2024 May-June · Paper 42 · Q2(c)(i)

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…

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

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 …

2024 May-June · Paper 42 · Q2(c)(iii)

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

2023 October-November · Paper 41 · Q3(a)(i)

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…

2023 October-November · Paper 41 · Q3(a)(ii)

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…

2023 October-November · Paper 41 · Q3(a)(iii)

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…

2023 October-November · Paper 41 · Q3(a)(iv)

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…

2023 October-November · Paper 41 · Q3(b)

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…

2023 October-November · Paper 41 · Q3(c)(i)

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…

2023 October-November · Paper 41 · Q3(c)(ii)

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…

2023 October-November · Paper 41 · Q3(d)

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…

2023 October-November · Paper 41 · Q3(e)(i)

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…

2023 October-November · Paper 41 · Q3(e)(ii)

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…

2023 May-June · Paper 32 · Q4

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…

2023 May-June · Paper 41 · Q1(a)(ii)

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]