Added 2.5.2006: This homework is harder than I thought. Do anything you can that validates the fields, and turn it in for very generous partial credit. We need to learn from this and move on.
Added 2.3.2006: There have been enough problems with this homework that I am postponing the due date until Thursday, Feb 9. And on that date we will have a quiz based on a model solution of the homework. I will give you the model solution along with the quiz. If you have done the homework and have understood the program, you should have no trouble with the quiz.
In the morning section Feb 2 we explored ways to keep all fields from turning yellow, when the user hadn't even entered any data. Two solutions were proposed. This is part of your challenge.
Homework 1 (both sections). Due before the start of class
Tuesday, February 7. Thursday, Feb 9.
This homework will be done in teams of two, which I have assigned. 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 in a lab, 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. Highly preferred: as an attachment to email to me. (ccnyddm@aol.com).
Team assignments get confused on the first homework, as people register after I’ve made up the teams, etc. If you don’t have a teammate at this point (Jan 27) just work by yourself. We’ll try to form teams in the lab on Tuesday. If all else fails, turn in an individual submission on the homework. And by the way, new teams are assigned for each homework, usually.
Modify HW1Jan16.java, in the folder named HW1Spring2006 on the course CD, to do the things in the following list. Look at the program to see how it handles events. Note that events are registered for only the first textfield and the Submit button. Your basic job is to complete the program so that it processes all five textfields in the same way.
And that’s it, unless you find problems (tell me!). You aren’t doing much actual programming; you can almost get this going if you can copy and paste. But we need one exercise like this to learn the basics of Eclipse, and we will study the program in class to understand the Java concepts, then extend these ideas in the second homework.
Here is the GUI produced by the starter kit program on the course CD, after the user entered some data:

Here is the window that pops up to acknowledge good data:

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 week or two. There are lots of concepts and details here.
Back to Dan McCracken's Home Page