Question: This question focuses on key concepts of Object Orientation Programming required for drone Simulator. (a) Describe and compare the Object Orientation Programming concepts of
This question focuses on key concepts of Object Orientation Programming required for drone Simulator. (a) Describe and compare the Object Orientation Programming concepts of Abstraction and Encapsulation. (3 marks) (b) Explain the concept of an ArrayList in Java and outline briefly how an ArrayList is created and used. (3 marks) (c) For the simulator, a class is required to represent a drone, which is able to move from its current position depending on its speed and the direction it is heading. The drone should have a unique identifier. (1) Describe the variables needed in the drone class. (11) Hence write the constructor for the drone. (111) Write a method to calculate the next position of the drone. (iv) Write a method which is passed another drone, and which reports whether the other drone overlaps with this drone. (8 marks) (d) The arena is rectangular which can have many drones in it. (1) Define the variables used in the arena class. (11) Write the constructor for an empty arena. (111) Write a method which is passed a drone, and which reports whether another drone overlaps with that drone. Hint: this should call the method you wrote in (c) (iv).
Step by Step Solution
There are 3 Steps involved in it
a Abstraction and Encapsulation are both key concepts of ObjectOriented Programming OOP Abstraction ... View full answer
Get step-by-step solutions from verified subject matter experts
