Question: Java need help with methods: This method will read the maze file and parse the maze to a 2d array of MazePoint objects. The input

Java need help with methods: This method will read the maze file and parse the maze to a 2d array of MazePoint objects. The input fileToRead is the filename of the maze you want to read. public MazePoint[][] readMaze(String fileToRead) throws IOException { // TODO: return maze; }

This method takes in two parameters - a file name, and a 2-d array of MazePoint objects, which represents the expected array that the readMaze method should yield after reading the file. The function returns a boolean value - true if the expected array matches the array returned by readMaze, and false otherwise. If the test fails it should also print the expected maze and the actual maze returned by readMaze along with an error message.

public boolean testRead(String fileToRead, MazePoint[][] expected) throws IOException { return false; }

Thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!