Project 4: Searching a File of Integers

This project is designed to teach about text File I/O.

Goal: You are part of an expeditionary force testing out a new submarine. Your commander thinks that one of the sensor arrays may be malfunctioning, because sensor readings have begun to deviate from the previously expected range. The commander sends you a file of integers (one per line) representing sensor readings and asks you to compute the largest integer in the file, the smallest integer in the file, and the average of all the integers in the file. He then asks you to write the results to an output file named "output.txt". He thinks for a moment, and then tells you that the names of the input and output files could change, that if you read something that is not an integer, your program should ignore it, and that the program should repeat asking for input until the user quits. He tells you that your program should not crash.

A good test strategy for this is to test your algorithm small files, from which you can verify easily that your program works. When writing a JUnit test harness, any files that are used for testing become part of the test code. In this case, that means they are part of your Eclipse project.

Your instructor will ask you to run your program against a specific file when you are ready to pass off your program, but you don't have access to that file until then.

You are required to generate Javadoc for the project that you submit in WebCT, but do not print the Javadoc for the hardcopy you submit in class.


Things to think about