Question: Question for Java game I have a Board Class. How do I: Update the class so that it implements interface IBoard TIP: Use Netbeans right
Question for Java game
I have a "Board" Class. How do I:
| Update the class so that it implements interface IBoard TIP: Use Netbeans right click menu, Insert Code, Implement Method to have the IDE generate the methods for you; you will replace the throw exception statements with the source code you write Add member variable of type:ArrayList of class String // stores dice data ArrayList of class String // stores dictionary data ArrayList of class Die // stores 16 game dice Add a custom constructor with two parameters of type ArrayList of class String; it should do the followingSet the member variable of type ArrayList of class String that stores the Boggle data equal to the associated parameter in the method signature Set the member variable of type ArrayList of class String that stores the dictionary data equal to the associated parameter in the method signature Instantiate the member variable of type ArrayList of class Die. Implement method populateDice; the method should do the following:Declare a variable of type class Die Declare and initialize a variable of type int to serve as a counter to access the data in the member variable of type ArrayList of type String storing the Boggle data Loop through the 16 dice (use the constant NUMBER_OF_DICE as your terminating condition):Instantiate the instance of class Die using the default no-argument constructor For each Die instance, loop through the six sides of the die (use the constant NUMBER_OF_SIDES as your terminating condition):Add each of the 6 letters to the Die ArrayList representing the die letters by calling method addLetter in class Die Display the letters of each die by calling method displayLetters() in class Die on a separate row Add each die instance to the ArrayList declared specifically for class Die |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
