GridWorld Case Study Critter Tips | AP Computer Science Exam Review

 

gridworld case study answers

Of the gridworld case study. Gridworld case study for answers. Project for which you will be reused in writing, the program. Gridworld case study search for it is a large part: A bug, Questions will. Sense for ap computer based on material in part, Implement and am at a similarly thorough review number of the. Homeschooled, Independent Study, and Students from Other Schools Schools That Administer AP Exams but Don’t Offer AP Courses Schools That Don’t Administer AP Exams. The GridWorld Case Study provides a graphical environment where visual objects inhabit and interact in a two-dimensional grid. In this case study, you will design and create “actor” objects, add them to a grid, and determine whether the actors behave according to their specifications. A graphical user interface (GUI) is provided that.


arrays - AnnoyingCritter GridWorld Case Study - Stack Overflow


Post a Comment. Tuesday, 1 February Gridworld Problems. Page 6 Questions 1. Does the bug always move to a new location?

No, it can turn. In which direction does the bug move? Straight if it can, unless it hits a rock or a wall and must turn clockwise. What does the bug do if it does not move? It turns it's direction if something is in its path.

What does a bug leave behind when it moves? It leaves behind a big flower that takes up the cell. What happens when the bug is at an edge of the grid?

Consider whether the bug is facing the edge as well as whether the bug is facing some other direction when answering this question. It turns 90 degrees clockwise.

What happens when gridworld case study answers bug has a rock in the location immediately in front of it? It turns 45 degrees clockwise that's to say it turns diagonally.

Does a flower move? Nope it's position is static. What behavior does a flower have? It doesn't move, but for each step it's color becomes darker until it's pitch black. Does a rock move or have any other behavior? No it doesn't move or act, gridworld case study answers, it simply remains in its place and acts as a block to the bugs. Can more than one actor bug, gridworld case study answers, flower, rock be in the same location in the grid at the same time?

No, only one object can take up a cell on the grid. Page 8 Questions 1. Test the setDirection method with the following inputs and complete the table, gridworld case study answers, giving the compass direction each input represents. Move a bug to a different location using the moveTo method. In which directions can you move it? How far can you move it? What happens if you try to move the bug outside the grid?

You can place it on any place gridworld case study answers the board, but it keeps its direction. If you try to place it outside you get an error. Change the color of a bug, a flower, and a rock. Which method did you use? I used the setColor method 4. Move a rock on top of gridworld case study answers bug and then move the rock again. What happened to the bug? The bug vanished as though it died. A blank cell remained. Questions on Page 12 1. What's the role of the instance variable sideLength?

It serves as a step limit on one side. If you say your sideLength is 2, and assuming there are no rocks around, the bug will walk in a box of length to. Furthermore, it will walk two steps on each side and then turn, and then another two steps, and then turn again, etc. For this reason the class is called BoxBug, it walks in a box shape so to speak, gridworld case study answers. What is the role of the instance variable steps? The steps serve as a count to know how many steps the bug can take until he must turn due to the sideLength variable.

Why is the turn method called twice when steps becomes equal to sideLength? The turn method is called twice when steps is equal to sideLength because the BoxBug again is made to walk in a box, gridworld case study answers, and each point in a box is 90 degrees. Since the turn method turns the bug 45 degrees it must be called twice to make the bug turn 90 degrees to complete the box pattern. Also the BoxBug is made to turn 90 degrees not only in the box pattern.

If it encounters a rock it will also call the turn method twice. Why can the move method be called in the BoxBug class when there is no move method in the BoxBug code? It can be called because the move method is inherited from the Bug class. Since it didn't have to be changed it wasn't overriden in the BoxBug class and that's the only reason why it isn't in the BoxBug code.

After a BoxBug is constructed, will the size of gridworld case study answers square pattern always be the same? Why or why not? It won't be the same given that other objects are on the grid.

If the BoxBug cannot move, and still hasn't completed all the steps on one side, it will still turn and break the pattern. Can the path a BoxBug travels ever change? As was mentioned earlier, it will not change unless other objects exist on the grid, which will affect it's turning. When will the value of steps be zero? The value of steps will be zero whenever the BoxBug turns, and at first when it's constructed.

Exercises Page 1. How is its behavior different from a BoxBug? The integer entries in the array represent how many times the bug turns before it moves. For example, an array entry of 5 represents a turn of degrees recall one turn is 45 degrees. When a dancing bug acts, it should turn the number of times given by the current array entry, then act like a Bug, gridworld case study answers.

In the next move, gridworld case study answers, it should use the next entry in the array. After carrying out the last turn in the array, it should start again with the initial array value so that the dancing bug continually repeats the same turning pattern.

To add another BoxBug to the grid would take two steps. First we gridworld case study answers initialize the BoxBug with the parameters it takes. Then we would have to add it to the grid. After that, the BoxBug that we have created will appear on the grid. No comments:. Newer Post Older Post Home. Subscribe to: Post Comments Atom.

 

Computer Science: Gridworld Problems

 

gridworld case study answers

 

Note: GridWorld will not be featured on the and subsequent AP CS Exams. The Critter class from the GridWorld Case Study is used on the AP Computer Science Exam to test your understanding of inheritance, postconditions, and a variety of other topics. The multiple choice section typically features one challenging question about the Critter class. One of the four problems on the free. The GridWorld case study was designed to allow teachers to introduce the material to students early in the AP Computer Science course and then use it throughout the school year. AP Computer Science teachers have the task of figuring out how and when to teach the case study material. The GridWorld Case Study provides a graphical environment where visual objects inhabit and interact in a two-dimensional grid. In this case study, you will design and create “actor” objects, add them to a grid, and determine whether the actors behave according to their specifications. A graphical user interface (GUI) is provided that.