Question
Cannot find symbol in Java Boggle class Create member variables of type: ArrayList of class String // stores data from data file with dice data
Cannot find symbol in Java
Boggle class | Create member variables of type: ArrayList of class String // stores data from data file with dice data String // set to the name of input file BoggleData.txt ArrayList of class String // stores data from data file with dictionary data String // set to the name of input file Dictionary.txt |
| Method main() should: Instantiate an instance of class ReadDataFile passing the file name variable for file BoggleData.txt as an argument Call method populateData on the above object Instantiate an instance of class ReadDataFile passing the file name variable for file Dictionary.txt as an argument Call method populateData on the above object Instantiate an instance of class Board passing as arguments method call getData on each of the two ReadDataFile object references from above Call method populateDice on object reference of class Board Output to the IDE output window the number of objects in the ArrayList of type String that stores the dictionary data |
IReadDataFile interface | Create interface IReadDataFile |
| Add method signature: populateData with no return type and an empty parameter list |
ReadDataFile class | Update the class so that it implements interface IReadDataFile 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 variables using the specified data types:Scanner // for reading the file String // for storing the file name ArrayList of class String // for storing the data from the file TIP: member variables should have an access level modifier of private to protect the data Add a custom constructor that receives one parameter of type String representing the name of the data file to read; it should do the following:Set the member variable of type String for storing the file name equal to the parameter Instantiate the member variable of type ArrayList Add a getter for the ArrayList member variable that stores the data read from the data fileTIP: Use the IDE right click menu, Refactor, Encapsulate Fields and select just getter for the member variable of focus Implement method populateData; it should do the following:Instantiate an instance of Java API class URL passing as an argument member variable representing the file name of the data fileTIP: this is a unique implementation, to instantiate the instance set the URL variable equal to static method call getClass().getResource() Instantiate an instance of class File using the URL created above Initialize member variable of type Scanner based on the File instance created aboveTIP: pass as an argument to the constructor the reference object of the URL instance with method call .toURI() Loop through the data file until the endAdd to the ArrayList representing the data in the file each value read from the data file |
import java.io.*; import java.util.ArrayList;
public class Boggle {
private static ArrayList
public class ReadDataFile implements IReadDataFile {
private Scanner inputFile; private String dataFileName; private ArrayList
public ReadDataFile(String fileName) { dataFileName = fileName; data = new ArrayList public static void main(String args[]){ ReadDataFile r = new ReadDataFile("BoggleData.txt"); r.populateData; r.getData } public interface IReadDataFile { public void populateData(); } I'm getting a "cannot find symbol" under ReadDataFile in the Board class. Im not quite sure why it's not coming together
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started