If using the zip version, extract the file and double-click the project.greenfoot file in the extracted folder

Open the editor for the GameManager class and import the API libraries for file input.

import java.io.*;
import java.util.Scanner;

Also in the GameManager class, add the readMap() method listed above.

Compile the program to verify you implemented the new method correctly.

To test the method, right-click on the scenario background and select the readMap(), entering an argument of: "maps/map1.txt" (with the quotes).

Remember to include the double-quote marks (") because the entry is a string. You should see the map file in the terminal window. If you have problems, ask a guild mate or the instructor for help as needed.

Save your updated scenario as we will be adding to it as the lesson continues.

When finished, please help those around you.

Be prepared to answer the following Check Yourself questions when called upon.

Check Yourself

When the number of file data items is unknown you can use a ________ statement to read all the data.

Of the following, the answer that is NOT a method of the Scanner class for testing the input stream is ________.

hasNext()

hasNextLine()

hasNextInt()

hasNoInput()

When typing the file name, double-quotes are required to indicate a data type of ________.