Homework 1 (both sections).
Due dates: 221 G: September 14, 2005
221 P: September 15, 2005
Homework is always due at the beginning of class
on the date given. (If I don't say that, people will be rushing in at the end of
the period, out of breath, having missed the entire lecture. This is not good
education.) Automatic 2 point (of 10) penalty for lateness.
This homework will be done in teams of two, which I will assign. I strongly urge you to work together closely. One proven technique: the two of you sit at one computer. One person types, the other watches, corrects, suggests, etc. Every 20 minutes or so you trade places. This is called pair programming, and is widely used in industry as well as in education. Try it. You might be surprised how effective it is.
Of course you can still work separately, on your own computers at home or wherever, and exchange code via email. But even if you do that, give pair programming a try anyway. And whatever else: each assigned team turns in one program.
All output still goes to the console, which is highly unrealistic. We will fix that in later homework.
Recall that the user must press Enter after entering data into any textfield, to activate the action listener on that field. There is no way to enter all the data, without pressing Enter, then click a Submit button. Also highly unrealistic; will also be fixed in future homework. It is still permissible to enter the data in any order, but in this version of the HW the ZIP needs to be entered last to get reasonable results.
We will make this application much more realistic in later homeworks. For a first homework you have a lot of things to learn: how to compile, how the starter program works, Java syntax, and more. We don’t try to do everything in the first homework.
Here is the GUI produced by the starter kit program on the course CD, after the user entered some data:

Here is the console input when the user pressed Enter after each entry:

It is very important that you do your own work on this. (In teams, of course.) You will be expected to be able to explain it, on a quiz. In a few weeks. There are a lot of concepts and details here.