Java Tuorial - OOP Language Basics Primitive Data Types Convert Units Conversion Tables
Updated : April 14, 2010 9:09 AM
* Represents a sidewalk of squares. public class Board { private data : ArrayList of Locations named board public Board() * Constructor that creates a board of 11 Locations * inserts a drunk in the middle. private void insertDrunk(int i) *makes the location a drunk public void outputStreet() * Outputs the street with dashes representing empty locations * and a D representing the drunk public int getDirection() * This method randomly returns either a 1 or a -1. public void stumble() * The drunk moves either to the left or the right. { //locate the drunk //get the direction to move //move the drunk from the old location to the new location }//end stumble public boolean atEndOfStreet() * Returns true if the first location or the last location contains * a drunk. }//end Board
Ala All Als Be Da D'Ar K Co K Cu Ki Lo My Sa Sc Vi Not Listed
Last Name :
Email :
Select one of the following that describes when and why you are filling out this form: This assignment is in on time. This assignment is in on time, being resubmitted due to a failed submission (I have a copy of the original submission). This assignment is a corrected submission for half the missed credit. This assignment is one day late and will lose 15%. This assignment is more than one day late (half credit at best). This assignment is late because of an EXCUSED absence. This assignment is being resubmitted at the request of the teacher.
Board Class code
Updated: Monday, January 3, 2011 2:11 PM