CSE 8B Spring 2001
Homework #4

Required reading: Savitch text Chapters 9 and Section 10.1 of Chapter 10. (You do not use Chapter 10 in the programming, but you should read the material.)

Turn in due date: Sunday, May 6(i.e., 8 am May 7)
Interview due date: Wednesday, May 9
DO NOT turnin hw4 before April 27. You can do hw4 before then and even take an interview, just do not turn it in before April 27.

Note: Material from this assignment will be covered on the midterm.

Note: You can do this and take an interview without turning in the assignment, as long as it is before the
turnin deadline (and until the deadline is announced it is definitely before the deadline).

Programming:
You may work in teams of two students, but once you form a team, you cannot change the team for this assignment. You may work alone if you prefer.

This is essentially Programming Project 1 in Chapter 9, but we have some more explicit instructions for this class, so read the version here.

Write a program that searches a file of numbers and outputs, the largest number in the file, the smallest number in the file, and the average of all the numbers in the file. The output should go to the screen. Do not assume that the numbers in the file are in any special order. Your program should obtain the file name from the user. Your program should also ask the user if it is a text file or binary file and should work for either. If it is a text file, assume the file contains one number per line. If it is a binary file, assume the file consists entirely of numbers of type double that were written using writeDouble.

Name your class NumberProbe so the file will be named NumberProbe.java.