Skip to main content.

Thursday, March 2, 2006
Due: Friday, March 10, 2006

Simpletron

In lab today, you should complete the implementation of the step method for the Simpletron simulator.

Homework Exercises

We will be learning more about file input/output in the next few lectures. In the meantime, you should know enough to start working on the following programs. Command line arguments are discussed in Advanced Topic 16.2. To test these programs as you write them, it will probably be best to run them from a terminal (DOS console) instead of Eclipse. To specify command line arguments in Eclipse, from the Run menu choose "Run..." (not "Run As" ... as we usually do). In the dialog box that appears, click on the Arguments tab and type in the command line arguments into the "Program arguments" text area. You can also change the Working directory here (i.e. the directory in which your program will start running, which is where the input/output files will be).

[40 points] Exercise P16.7 (page 605). (Hint: Use FileReader and FileWriter objects with their read and write methods. I don't think you will need a Scanner object for this program.)

[40 points] Exercise P16.8 (page 605). (Hint: You can probably use a Scanner object with its next() method, and the indexOf method of the String class for this.)

[40 points (extra credit)] Exercise P16.9 (page 605). (You can do a Google search for "word list" or "dictionary words" to find a word list file. Initially, you should probably test your program on a small file. Given that we have not studied any advanced data structures or algorithms (CSC220/320), I don't expect that your program should run very fast.)