
What you need to know is that the interface Grid specifies the methods for any grid that contains objects of the type E which you choose at its initialization.įor part A we will be working with the class BoundedGrid which implements the Grid Interface. You may be unfamiliar with interfaces so don’t worry too much about how they work. The next important part is the Grid Interface. The Location class encapsulates the coordinates for an Actor object’s position in a Grid. Every actor that appears in the Grid has a Location. The first necessary class is the Location class. Since this case study is no longer in the AP Java curriculum, all the necessary documentation is provided below. In this case study, students designed and created Actor objects, added them to Grid objects, and determined whether the Actor objects behaved according to their specifications. The GridWorld case study provided a graphical environment where visual objects inhabited and interacted in a two-dimensional grid (similar to GreenFoot). Each empty location should appear exactly once in the Arraylist. Otherwise, it returns an Arraylist of all empty locations in In grid, the method returns an empty Arraylist. In this question, you will write the GridWorldUtilities method getEmptyLocations. A partial declaration of the GridWorldUtilities class is shown below. The GridWorldUtilities class contains static methods. In part (a) you will write a method to return an Arraylist of all empty Location objects in a given grid. It is no longer expected that you know this information and it will be provided to you in this question.īecause there is a lot of extra material that you need to read and understand, this question may seem more challenging and will require more time than a typical FRQ you would expect on your AP exam. This question involves reasoning about the GridWorld case study that was formerly required knowledge for the APCSA exam.
#Greenfoot null pointer exception free#
You can see all the free response questions from past exams at. The following is a free response question from 2013.

#Greenfoot null pointer exception code#
7.10 Toggle Mixed Up or Write Code Practice.7.7 Ethics of Data Collection and Data Privacy.

