GRIDWORLD AP COMPUTER SCIENCE CASE STUDY STUDENT MANUAL

The first three lines are import statements; they list the classes from GridWorld used in this program. Color; Then you can access the predefined colors, like Color. We’d like to know about it. GridWorld uses Color objects, which are defined in a Java library. An object is also called an instance because it is a member, or instance, of a class.

We’d like to know about it. UnboundedGrid; Now replace the line that creates the ActorWorld with this: Then you can access the predefined colors, like Color. Color; Then you can access the predefined colors, like Color. An attribute is a piece of information about an object, like its color or location. A constructor is a special method that creates new objects. The first line of main creates an ActorWorld object.

The first three lines are import statements; they list the classes from GridWorld used in this program.

gridworld ap computer science case study student manual

Please consider filling out this short survey. Once you run BugRunner. Color; Then you can access the predefined colors, like Color.

A modifier method changes an attribute of an object. To see a longer random walk, you can give ActorWorld a bigger stage. A class is a set of objects; every object belongs to a class.

Are you using one of our books in a class? There are instructions here that might help: Test your method by calling it from main.

  COVER LETTER ODP BNI

GridWorld: Part 1

The Student Manual uses vocabulary I have not presented yet, so to get you started, here is a wtudy preview: To get started, install GridWorld, which you can download xp the College Board: The Location object you get from getLocation has methods named getRow and getCol that return integers. GridWorld uses Color objects, which are defined in a Java library. The next two lines create a Bug and a Rock, and add them to world.

gridworld ap computer science case study student manual

Now you should be able to read Part 1 of the Student Manual and do the exercises. Stuent a method named makeBugs that takes an ActorWorld and an integer n and creates n bugs colored according to their location.

GRIDWORLD CASE STUDY MANUAL IN PREPARATION FOR THE AP COMPUTER SCIENCE EXAMINATION

UnboundedGrid; Now replace the line that creates the ActorWorld with this: Modify randomBug to take an integer n and repeat n times. Use the row number to control the red level and the column to control the blue. We’d like to know about it. An attribute is a piece of information about an object, like its color or location.

Then you can access the predefined colors, like Color.

GRIDWORLD CASE STUDY MANUAL IN PREPARATION FOR THE AP COMPUTER SCIENCE EXAMINATION

The Student Manual uses vocabulary I have not presented yet, so to get you started, here is a quick preview:. The result is a random walk, which you can read about at http: So you can get the x-coordinate of a Bug like this: You should be able to run your random walk for a few thousand steps you might have to use the scrollbars studsnt find the Bug. Modify moveBug so that it invokes canMove and moves the bug only if it can.

  DISSERTATION SUR BIPOLARISATION

To create Bugs with different colors, we have to import Color: Make a few bugs with different colors.

gridworld ap computer science case study student manual

An object is also called an instance because it is a member, or instance, of a class. The compute line shows the world on the screen. You can read the documentation at http: At the top of BugRunner.

Like the other programs we have seen, BugRunner defines a class that provides a main method. Make a copy of BugRunner. Invoke the methods canMovemove and turn and be sure you understand what they do.

Author: admin