Further programming
152 questions. Open a question to solve it and check the official answer.
Programming paradigms · 3 marks · official answer ready
(iii) The method GetPosition() returns a string of the bird’s data in the format: "X = " & & " Y = " & An example string for a bird is: X = 500.0 Y = 250.0 Write program code for …
Programming paradigms · 5 marks · official answer ready
(iv) If the bird is travelling north, the vertical position increases. If the bird is travelling south, the vertical position decreases. If the bird is travelling east, the horizo…
Programming paradigms · 3 marks · official answer ready
(b) The main program creates two instances of Bird The first bird is the species ‘Cockatiel’ and flies 71.0 km/h. The second bird is the species ‘Macaw’ and flies 56.0 km/h. Write…
Programming paradigms · 8 marks · official answer ready
(i) The main program needs to: • output a message that includes the species and current X position and Y position for each bird • prompt the user to select one of the birds to mov…
Programming paradigms · 3 marks · official answer ready
(ii) Test your program four times to meet these criteria: Test 1: The Cockatiel travels north for 60 minutes. Test 2: The Macaw travels south for 30 minutes. Test 3: The Cockatiel…
File processing and exception handling · 4 marks · official answer ready
(c) The text file TreeData.txt stores 50 integers. Each integer is on a new line in the file. The main program reads each integer from the file and stores each integer in the bina…
Programming paradigms · 5 marks · official answer ready
(i) Write program code to declare the class BoardObject and its constructor. Do not declare the other methods. Use your programming language appropriate constructor. If you are wr…
Programming paradigms · 3 marks · official answer ready
(ii) The methods GetCode() and GetValue() return the appropriate attribute. Write program code for GetCode() and GetValue() Save your program. Copy and paste the program code into…
Programming paradigms · 3 marks · official answer ready
(iii) The table shows the code and value of five board objects. The table has the variable identifier where each of the objects are stored. Variable Code Value identifier Object1 …
Programming paradigms · 0 marks
(b) The board objects are placed on a board that is represented by a 0-indexed 2D array: • the board is a 10 x 10 grid • each position on the board is identified by a row and colu…
Programming paradigms · 4 marks · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 2 marks · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 2 marks · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 3 marks · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 3 marks · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 1 mark · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 4 marks · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 1 mark · official answer ready
1 A program stores data for a board game using Object-Oriented Programming (OOP). The game has objects that are placed on the board. Each object has a string code (for example "A"…
Programming paradigms · 1 mark
(i) Identify the object-oriented programming (OOP) feature whose function includes restricting external access to the data. .......................................................…
Programming paradigms · 2 marks · official answer ready
(ii) Describe what is meant by the OOP feature inheritance. .......................................................................................................................…
