Computer Science For First Examination In 2021 9618 · 20

Further programming

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

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

Programming paradigms · 2 marks · official answer ready

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

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

Programming paradigms · 4 marks · official answer ready

(ii) The method InsertNode(): • takes an integer as a parameter • creates a new node with the parameter as the integer data • uses the new node’s method SetNextNode() to store the…

2025 May-June · Paper 43 · Q3(c)(i)

Programming paradigms · 3 marks · official answer ready

(i) The main program creates a new LinkedList object and uses the appropriate method to insert five nodes with the following integer data values in the order given: 10 20 30 40 50…

2025 May-June · Paper 43 · Q4(f)(ii)

Programming paradigms · 2 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] (f) (ii) Test your program. Take…

2024 October-November · Paper 31 · Q9(b)

Programming paradigms · 5 marks · official answer ready

(b) Complete the class diagram for Pet, to include: • an attribute and data type for the name of the pet • an attribute and data type for the name of the owner • a method to creat…

2024 October-November · Paper 32 · Q10(a)

Programming paradigms · 3 marks · official answer ready

(a) Outline the structure of a class. .............................................................................................................................................…

2024 October-November · Paper 32 · Q10(b)

Programming paradigms · 3 marks · official answer ready

(b) Give three differences between an object and a class. 1 .......................................................................................................................…

2024 October-November · Paper 33 · Q9(b)

Programming paradigms · 5 marks · official answer ready

(b) Complete the class diagram for Pet, to include: • an attribute and data type for the name of the pet • an attribute and data type for the name of the owner • a method to creat…

2024 October-November · Paper 41 · Q1(a)

File processing and exception handling · 6 marks · official answer ready

(a) The text file Data.txt stores string data items. Each data item is on a new line in the text file. The function ReadData(): • has a local array of strings that can store 45 it…

2024 October-November · Paper 41 · Q2(a)(i)

Programming paradigms · 4 marks · official answer ready

(i) Write program code to declare the class Horse and its constructor. Do not declare the other methods. Use your programming language’s appropriate constructor. All attributes mu…

2024 October-November · Paper 41 · Q2(a)(ii)

Programming paradigms · 3 marks · official answer ready

(ii) The get methods GetName() and GetMaxFenceHeight() each return the relevant attribute. Write program code for the get methods. Save your program. Copy and paste the program co…

2024 October-November · Paper 41 · Q2(b)(i)

Programming paradigms · 5 marks · official answer ready

(i) The program has two horses: • The horse named ‘Beauty’ can jump a maximum height of 150 cm and has a success percentage rate of 72%. • The horse named ‘Jet’ can jump a maximum…

2024 October-November · Paper 41 · Q2(b)(ii)

Programming paradigms · 1 mark · official answer ready

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

2024 October-November · Paper 41 · Q2(c)(i)

Programming paradigms · 4 marks · official answer ready

(i) Write program code to declare the class Fence, its constructor and get methods. Use your programming language’s appropriate constructor. All attributes must be private. If you…

2024 October-November · Paper 41 · Q2(c)(ii)

Programming paradigms · 5 marks · official answer ready

(ii) The array Course stores four Fence objects. The user inputs the height and risk for each fence, and these are validated before each fence is created. Amend the main program t…

2024 October-November · Paper 41 · Q2(d)

Programming paradigms · 5 marks · official answer ready

(d) The chance of a horse jumping a fence without knocking it down is calculated as follows. If the height of the fence is more than the maximum height a horse can jump, the succe…

2024 October-November · Paper 41 · Q2(e)(i)

Programming paradigms · 3 marks · official answer ready

(i) Write program code to amend the main program to: • calculate and output the chance of the first horse jumping each of the four fences without knocking each fence down • calcul…

2024 October-November · Paper 41 · Q2(e)(ii)

Programming paradigms · 2 marks · official answer ready

(ii) Write program code to amend the main program to: • calculate and output the average chance of success for each horse jumping over all four fences without knocking each fence …

2024 October-November · Paper 41 · 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 October-November · Paper 42 · Q1(a)(i)

Programming paradigms · 4 marks · official answer ready

(i) Write program code to declare the class EventItem and its constructor. Do not declare the other methods. Use your programming language’s appropriate constructor. All attribute…