Further programming
192 questions. Open a question to solve it and check the official answer.
Programming paradigms · 5 marks · official answer ready
(v) The OutputListToConsole method is to output all the data stored in the linked list. HeadPointer points to the first list node. Write program code for this method. Programming …
Programming paradigms · 6 marks · official answer ready
(vi) The structured English for the AddToList(NewString) method is as follows: Make a copy of the value of free list pointer, name it NewNodePointer Store new data item in free no…
Programming paradigms · 3 marks · official answer ready
(a) The programmer designed the pseudocode for the main program as follows: DECLARE Island : IslandClass.Constructor() // instantiate object CALL DisplayGrid() // output island sq…
Programming paradigms · 5 marks · official answer ready
(b) Write program code to declare the IslandClass and write the constructor method. The value to represent sand should be declared as a constant. Programming language used .......…
Programming paradigms · 2 marks · official answer ready
(i) Write program code for the GetSquare(Row, Column) getter method. ..............................................................................................................…
Programming paradigms · 4 marks · official answer ready
(ii) Write program code for the DisplayGrid procedure. ............................................................................................................................…
Programming paradigms · 5 marks · official answer ready
(d) Write program code for the HideTreasure method. Your method should check that the random location generated does not already contain treasure. The value to represent treasure …
Programming paradigms · 3 marks · official answer ready
(i) The DigHole method takes two integers as parameters. These parameters form a valid grid location. The location is marked with 'X' or 'O' as appropriate. Write program code for…
Programming paradigms · 5 marks · official answer ready
(ii) The StartDig procedure: • prompts the player for a location to dig • validates the user input • calls the DigHole method from part (e)(i). Write program code for the StartDig…
Programming paradigms · 1 mark · official answer ready
(i) The squares in the IslandClass grid could have been declared as objects of a Square class. State the term used to describe the relationship between IslandClass and Square. ...…
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] 18 19 20 reasonable effort has been made by the publis…
Programming paradigms · 1 mark · official answer ready
(i) State the term used to describe the relationship between these classes. .......................................................................................................…
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
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…
Programming paradigms · 1 mark · official answer ready
(i) Explain the meaning of the term null pointer. .................................................................................................................................…
Programming paradigms · 2 marks · official answer ready
(ii) Give an appropriate value to represent the null pointer for this design. Justify your answer. ................................................................................…
Programming paradigms · 7 marks · official answer ready
(iii) Write program code for the LinkedList class declaration and the constructor. Programming language used ......................................................................…
Programming paradigms · 1 mark · official answer ready
(iv) Write program code to instantiate a linked list object with the contacts identifier. Programming language used ...............................................................…
Programming paradigms · 5 marks · official answer ready
(v) The OutputListToConsole method is to output all the data stored in the linked list. HeadPointer points to the first list node. Write program code for this method. Programming …
Programming paradigms · 6 marks · official answer ready
(vi) The structured English for the AddToList(NewString) method is as follows: Make a copy of the value of free list pointer, name it NewNodePointer Store new data item in free no…
