Computer Science 9608 · 20

Further programming

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

Reset
2017 October-November · Paper 41 · Q6(a)

Programming paradigms · 6 marks · official answer ready

(a) Write program code to declare the attributes and constructor for the Animal class. You only need to write the set and get methods for the attribute Across. You should also wri…

2017 October-November · Paper 41 · Q6(b)

Programming paradigms · 5 marks · official answer ready

(b) The Constructor method of the Desert class: • initialises an empty grid • creates 5 animal objects which are added to the AnimalList (an array of animal objects currently on t…

2017 October-November · Paper 41 · Q6(c)(i)

Programming paradigms · 4 marks · official answer ready

(i) The function GenerateChangeInCoordinate: • receives a coordinate (across or down number) as a parameter • checks whether the coordinate’s value is at a boundary of the grid • …

2017 October-November · Paper 41 · Q6(c)(ii)

Programming paradigms · 4 marks · official answer ready

(ii) The Move method uses the GenerateChangeInCoordinate function to calculate the new Across and Down values for an animal. If there is food in the new position in the grid, the …

2017 October-November · Paper 41 · Q6(d)

Programming paradigms · 2 marks · official answer ready

(d) The programmer plans to add a graphic display to the program. The programmer will make use of a program library. Explain what is meant by a program library. ..................…

2017 October-November · Paper 42 · Q6(a)

Programming paradigms · 3 marks · official answer ready

(a) Complete the class diagram. Account AccountNumber : STRING Balance : CURRENCY Constructor() GetAccountNumber() GetBalance() SetAccountNumber() SetBalance() CurrentAccount Savi…

2017 October-November · Paper 42 · Q6(b)

Programming paradigms · 5 marks · official answer ready

(b) Write program code to declare the Account class. Programming language .........................................................................................................…

2017 October-November · Paper 42 · Q6(c)

Programming paradigms · 5 marks · official answer ready

(c) Write program code to declare the SavingsAccount class. Do not write any get or set methods. Programming language .............................................................…

2017 October-November · Paper 43 · Q6(a)

Programming paradigms · 6 marks · official answer ready

(a) Write program code to declare the attributes and constructor for the Animal class. You only need to write the set and get methods for the attribute Across. You should also wri…

2017 October-November · Paper 43 · Q6(b)

Programming paradigms · 5 marks · official answer ready

(b) The Constructor method of the Desert class: • initialises an empty grid • creates 5 animal objects which are added to the AnimalList (an array of animal objects currently on t…

2017 October-November · Paper 43 · Q6(c)(i)

Programming paradigms · 4 marks · official answer ready

(i) The function GenerateChangeInCoordinate: • receives a coordinate (across or down number) as a parameter • checks whether the coordinate’s value is at a boundary of the grid • …

2017 October-November · Paper 43 · Q6(c)(ii)

Programming paradigms · 4 marks · official answer ready

(ii) The Move method uses the GenerateChangeInCoordinate function to calculate the new Across and Down values for an animal. If there is food in the new position in the grid, the …

2017 October-November · Paper 43 · Q6(d)

Programming paradigms · 2 marks · official answer ready

(d) The programmer plans to add a graphic display to the program. The programmer will make use of a program library. Explain what is meant by a program library. ..................…

2017 May-June · Paper 41 · Q4(a)(i)

Programming paradigms · 1 mark · official answer ready

(i) State the term used to describe the relationship between these classes. .......................................................................................................…

2017 May-June · Paper 41 · Q4(a)(ii)

Programming paradigms · 2 marks · official answer ready

(ii) Draw the appropriate diagram to represent this relationship. Do not list the attributes and methods of the classes. [2] 9

2017 May-June · Paper 41 · Q4(b)

Programming paradigms · 5 marks · official answer ready

(b) The design for the Node class consists of: • attributes Data : STRING Pointer : INTEGER • methods CreateNode(Data, Pointer) SetData(Data) SetPointer(Pointer) GetData() RETURNS…

2017 May-June · Paper 41 · Q4(c)(i)

Programming paradigms · 1 mark · official answer ready

(i) Explain the meaning of the term null pointer. .................................................................................................................................…

2017 May-June · Paper 41 · Q4(c)(ii)

Programming paradigms · 2 marks · official answer ready

(ii) Give an appropriate value to represent the null pointer for this design. Justify your answer. ................................................................................…

2017 May-June · Paper 41 · Q4(c)(iii)

Programming paradigms · 7 marks · official answer ready

(iii) Write program code for the LinkedList class declaration and the constructor. Programming language used ......................................................................…

2017 May-June · Paper 41 · Q4(c)(iv)

Programming paradigms · 1 mark · official answer ready

(iv) Write program code to instantiate a linked list object with the contacts identifier. Programming language used ...............................................................…