Please send questions to st10@humboldt.edu .

CIS 480 - Spring 2001
HW #6
Due: Monday, April 16, 2001, beginning of lecture

Remember the class style standards at the end of this handout...

Note that you need to write 3 distinct, different Java programs for
this assignment. (You MUST send AT LEAST 3 e-mails, with the Subject:
lines Hw6Num1.java, Hw6Num2.java, and Hw6Num3.java.)

If you meet the minimum requirements below, that up to 90% credit.  If
you do something interesting in these programs, that's how you can
get up to 100%. Note that the possibilities given below do count as
"interesting" in this sense.

1. [20%] Write an AWT applet or application using an AWT frame that involves 
NON-double-buffered animation. 
	*   you must include your name somewhere within your 
	applet or application;

	*   you may choose to extend Thread or implement Runnable;

        *   you pick the image or images; anything but the train...

	*   animate it in some interesting way besides strictly 
	horizontal, vertical, in a straight line, or totally random
	jumping about;

	*   incorporate nicely-placed start and stop buttons to
	resume and suspend the animation in a proper, non-deprecated
	fashion.

	*   name your resulting code Hw6Num1.java

	*   some possibilities:
	        *   a ball image can "bounce" off the edges of
		a frame or applet and careen in a different
		direction;

		*   some appropriate image travelling in a
		parabola or interesting curve could work;
		(a sun or moon arcing across the "sky" of
		the applet or application?)

		*   two images could collide and change 
		direction as a result of their collision;

2. [20%] Now --- modify your Hw6Num1.java to use double-buffering.
        *   name your resulting code Hw6Num2.java

3. [50%] Write a Swing application using a JFrame that implements
a rudimentary survey facility.
	*   you must include your name somewhere within your 
	application;

	*   name your resulting code Hw6Num3.java

        *   you must provide some way for the user to indicate
	the name of a file of survey questions to be asked.
	        *   it could be as simple as a JTextArea with
		filenames in the current working directory
		listed and a JTextField to then enter in the 
		filename chosen (as in the in-class example);

		*   or, you can choose more sophisticated means
		of permitting this choice.

		*   it is assumed that survey files are created
		before your program is run, and that such files
		consist of sets of questions, one question per
		line.

	*   you must *also* provide some way for each question
	in the chosen file to be asked, and the answers then
	recorded into a file of the *user's* choice.
		*   you need to ask the user into a file with
		what name the answers should be recorded;
		this can be done with a JTextField, or with a
		more sophisticated component.

	        *   then, it could be as simple as having a JLabel 
		or JTextField that gets filled in turn with each 
		question read from the file, and a JTextField into 
		which the user enters each answer in turn. 
		(Alternatively, you could allow all the answers to 
		appear in a JTextArea.)

		*   but, at some point or points, all of the 
		answers to the questions asked must be written 
		to the file chosen by the user.

	*   you may add additional features as desired, as long
	as at least the above requirements are met.

	*   a relatively pleasing layout is expected.

Minimal style standards (to be added to, if necessary!)
	*   If you want to "paint" using Swing components,
	use the guidelines as discussed in class and as demonstrated
	in the in-class examples.
	
	*   If your program involves gif files, either include
	them as attachments in a separate e-mail file with
	"Subject: [program name] images", OR include them on a web
	page using the tag:	<img src="YOUR_IMAGE.gif">
	and include the URL for this page in your opening comment
	block. 
	        *   The names of all required gifs, in either case,
		must be included prominently and neatly in the opening
		comment block, also.  

        *   Java GUI applications must always include 
	System.exit(0), and must handle window closing gracefully;

	*   Run-time exceptions (such as, but not limited to,
	NumberFormatExceptions) should be handled gracefully
	by proper use of try-catch blocks.

	*   Any applet (AWT or Swing) must include in
	its opening comment block its recommended size.

	*   every Java source file should begin with at least
	a small block comment describing the purpose of what
	is within, and including your name. If you are modifying
	existing code (such as an in-class example), you should
	indicate that, also.

	*   programs are expected to have at least a few
	descriptive internal comments

	*   neat, consistent indenting is required.

	*   reasonably-descriptive and non-misleading variable
	names are expected.

Then, send (at least) three e-mails to st10@humboldt.edu as follows:
        *   each Subject: line should be either:
                *   the name of Java source contained within that 
	        e-mail message, OR 

	        *   the required name of the Java source that 
	        would be contained there, if one program were not 
	        being used for several parts, OR

	        *   <required_java_source_name> images, if
	        it contains required image attachments.

        *   the *body* of the e-mail should contain either:
	        *   the Java source (NOT included as an attachment!),
		OR

		*   the name of the Java source to be graded
		for this part, also; OR,

		*   the image file(s), as attachments.

        *   please FIX the indenting in the Java source code
        if it is ugly when placed in the e-mail body! (Source code
        pasted from BlueJ sometimes requires such clean-up.)