Northern Michigan University

Department of Mathematics/Computer Science

CS120 Programming 1 Section 04 Fall 2002

Assignments

latest update: 26 August 2002

Assignments are due one week from the date assigned unless specified otherwise

All communications to the instructor regarding assignments are to be sent to L@Ellerbruch.nmu.edu unless specified otherwise.

Get and install Java SDK Wed 28 August 2002.

Get and install Textpad Wed 28 August 2002.

E1 - 10pts due Friday 8/30/02

Make a personal link page. Put it in your special personal password protected folder on the Instructor's server Ellerbruch.nmu.edu as shown in class.

You will be notified in class and here on the assignment page when the folders are ready.

The link page will be your connection between the class roster and your assignments. You will put your assignments in your folder and provide links on your link page. The link page must have three parts.

Part 1. Include a title for the page, a header on the page, and any favorite links you wish to have. The title and header should include your last name.

Part 2. Links to assignments as they are completed with descriptions of the assignments.

Part 3. Links to return to significant pages (as a minimum you need to be able to return to the CS120 home page.) and identification information. Be sure to have your name and e-mail address at the bottom as creator of the page.

This MUST NOT be an elaborate personal home page. If you want to put an additional elaborate personal home page in your folder, it is permitted as long as the size (including graphics) is not excessive. If you have a personal home page, link it to your link page. The path to your folder is:

http://Ellerbruch.nmu.edu/classes/cs120f02/CS120students/YourNMU_EmailAddress/

The full pathname format for your page would be:

http://Ellerbruch.nmu.edu/classes/cs120f02/CS120students/YourEmailAddress/LastName.html

The name of the file should be YourLastName.html

After your link page is installed in your folder, send a message to L@Ellerbruch.nmu.edu informing me of such. Use a sensible subject.

H1 - 10pts due Friday 9/6/02

Modify StaticApplet to display several graphics objects. Compile and run then link to your link page and place a copy of the entire folder H1 containing all the parts for running StaticApplet as modified, and the revised link page in your password protected folder on your instructor's server (Ellerbruch.nmu.edu).

H2 - 10pts due Monday 9/15/02

Modify StaticApplet to display multiple copies (at least three) of one graphics object using the techniques from class. Put the completed project in your personal folder on Ellerbruch.nmu.edu and link it to your link page. The name on the folder should be H2. Make sure it works over internet.

Requirements include:

Author's name and program "title" in comments at the beginning of the program source.

The paint method can only use names of other methods.

The paint method will tell the graphics objects where to display on the screen by calling another method to create the graphics object in the location specified by the paint method using parameters.

The method for the graphics object must be of general form and flexible in the way it can be used.

The graphics object must be a composite graphic. It has to be made up of several shapes.

The form and format of the program must follow techniques described in class.

The window must be 400 by 300.

File names must not have spaces.

The program must work over internet.

H3 - 10pts due Wednesday 9/17/02

Modify StaticApplet to display multiple copies (at least three) of one graphics object using a while loop. You can actually duplicate H2 and use that object to complete this assignment. Put the completed project in your personal folder on Ellerbruch.nmu.edu and link it to your link page. The name on the folder should be H3. Make sure it works over internet. Remember, do not change the names of the files in the folder.

Requirements include:

Author's name and program "title" in comments at the beginning of the program source.

The paint method can only use names of other methods.

The loop can be in a method of its own or in the graphics object method. There must be a method to create the graphics object and its location must be determined by a while loop.

The method for the graphics object must be of general form and flexible in the way it can be used.

The graphics object must be a composite graphic. It has to be made up of several shapes.

The form and format of the program must follow techniques described in class.

The window must be 400 by 300.

File names must not have spaces or unusual characters.

The program must work over internet.

H4 10 points due Friday 9/19/02

Modify StaticApplet to display a border around the display window. The border must be created using "while" statements (loops). Put the completed project in a folder named H4 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet.

Requirements include:

There must be a comment at the beginning of the program displaying the program name/description and author's name.

The paint method can only use names of other methods.

The methods for the border must use "while" loops to create the borders.

The border must be made up of repeated copies of a graphics object.

The window must be 400 by 300.

File names must not have spaces or unusual characters.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H5 10 points due Friday 9/27/02

Modify EventApplet to move an object with the mouse.

Use the object from H3 or H4 (or create a new one) and have it move left or right with a mouse click. If the user clicks on the right side of the screen, have the object move right 10 pixels to the right, if on the left, 10 pixels to the left. Start the object in the "center" of the screen. Put the completed project in a folder named H5 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet.

Requirements include:

There must be a comment at the beginning of the program displaying the author's name and program name/description.

The paint method can only use names of other methods.

The decision to move must be in the mousePressed method and must change a state variable.

The window must be 400 by 300.

File names must not have spaces or unusual characters.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H6 10 points due Monday 9/30/02

Modify EventApplet to change the color of an object with the keyboard. You can just add a keyPressed method and state variable to H5.

Use the object from H5 (or create a new one) and have it change color using key strokes. Put the completed project in a folder named H6 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet.

Requirements include:

There must be a comment at the beginning of the program displaying the author's name and program name/description.

The paint method can only use names of other methods.

There must be "instructions" for the keys to use.

Upper and lower case letters must both work.

The decision to change color must be in the keyPressed method and must change a state variable.

The window must be 400 by 300.

File names must not have spaces or unusual characters.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H7 10 points due Wednesday 10/2/02

Modify H5 to have barriers on the mouse move to keep the object inside the graphics window.

Use the object from H5 (or create a new one) and have it move left or right with a mouse click. If the user clicks on the right side of the screen, have the object move right 10 pixels to the right, if on the left, 10 pixels to the left. Start the object in the "center" of the screen. Include barriers so the object will not move out of the graphics window. You can just modify H5. Put the completed project in a folder named H7 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet.

Requirements include:

There must be a comment at the beginning of the program displaying the author's name and program name/description.

The paint method can only use names of other methods.

The decision to move must be in the mousePressed method and must change a state variable.

Barriers must be used.

The window must be 400 by 300.

File names must not have spaces or unusual characters.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H8 10 points due Friday 10/4/02

Move an object with the keyboard. You can just add a keyPressed method and state variable to H7. Barriers must be incorporated to keep the object inside the graphics window.

Use the object from H7 (or create a new one) and have it move using key strokes (the arrow keys). Put the completed project in a folder named H8 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet.

Requirements include:

There must be a comment at the beginning of the program displaying the author's name and program name/description.

The paint method can only use names of other methods.

There must be "instructions" for the keys to use.

There must be a "move" in the keyPressed method and must change a state variable.

Barriers must be included.

The window must be 400 by 300.

File names must not have spaces or unusual characters.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H9 10 points due Monday 10/7/02

Modify H6 to change the color of an object with Buttons. You can just add buttons to H6 or H7 or H8.

Use the object from H6-H8 (or create a new one) and have it change color using mouse clicks on pseudo-buttons. Put the completed project in a folder named H9 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet.

Requirements include:

There must be a comment at the beginning of the program displaying the author's name and program name/description.

The paint method can only use names of other methods.

There must be at least three pseudo-buttons for changing color.

The "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility.

There must be "instructions" for the keys to use if you use them.

Upper and lower case letters must both work.

Barriers must be included if the object can be changed beyond reasonable bounds.

The decision to change color must be in the keyPressed method and must change a state variable.

The window must be 400 by 300.

File names must not have spaces or unusual characters.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H10 20 points due Friday 10/11/02

Modify EventApplet to use text fields to complete exercise number 4 (sort 3 numbers) in the text, section 3.9

Put the completed project in a folder named H10 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet. The source should be available from a link. At this time it may be necessary to use Internet Explorer to run the applet.

Requirements include:

Author's name and program "title" in comments at the beginning of the program. State which exercise you are doing.

The paint method can only use names of other methods.

The program must be interactive.

You must have a complete "solution" for exercise #4 in section 3.9 (page 3-18.)

Any "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H11 20 points due Wednesday 10/16/02

Modify EventApplet to use a text field to complete exercise number 5 (sum integers) in the text, section 3.9

Put the completed project in a folder named H11 in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet. The source should be available from a link. At this time it may be necessary to use Internet Explorer to run the applet.

Requirements include:

Author's name and program "title" in comments at the beginning of the program. State which exercise you are doing.

The paint method can only use names of other methods.

The program must be interactive.

You must use a loop to find the sum.

You must have a complete "solution" for exercise #5 in section 3.9 (page 3-18.)

Any "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H12 20 points due Monday 10/21/02

Modify H7 or create a new modification of EventApplet to display at least two graphic objects in the display window. Place user designed "pseudo-buttons" in the window to change the objects. Allow interaction by clicking on the buttons with the mouse. There must be a controller class to build at least two instances of a graphics object. There must be a button class to build the button objects and an object class to build the graphics objects. The main program must be a controller class only. The program can be a modification of H7. You must write the graphics object class and the controller. You can use the AButton class as presented in the text or in class. The program can consist of all the classes in one file or each class in a separate file. If you have the classes in separate files, the html access to the source files must be modified to allow all the source files to be available.

Put the completed project in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet. At this time it may be necessary to use Internet Explorer to run the applet.

Requirements include:

Author's name and program "title" in a comment at the beginning of the program.

Objects created by classes are necessary.

The main program is a "controller" class only.

The paint method can only use names of other methods.

The program must be interactive.

The graphics objects must be built with a class. You can have more than one graphics object class, but one of them must be used to create at least two instances of the graphics object.

There must be at least two sets of two pseudo-buttons built with a button class. Each set will provide "opposite" effects, ie if one makes the graphic larger, the other makes it smaller. Two different types of effects must be provided (four directional movements will not meet the requirement.) Options can include change size, change color or intensity of color (darker - lighter), change number of shapes, or move objects. Others options are available, check with the instructor if you have questions about the appropriateness of your button options.

The "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility.

Barriers must be used to keep changes from becoming unreasonable.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

All source code must be availabe from the html file which runs th applet.

H13 30 points due Monday 10/28/02.

Modify the House program in Chapter 5.3. You are encouraged to work in teams. You should have the house entered and running during lab time for the class. You MUST have the modification which allows the windows to light up or turn off by clicking on them and a report on screen of how many windows are lit. You must have the ability to change the color of the house through clicking on a button.

Put the completed project in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet. Remember, at this time it may be necessary to use Internet Explorer to run the applet.

Requirements include:

Author's name and program "title" in a comment at the beginning of the program. If you worked with anyone on this program, the team member names must all be here.

The program must be a modification of the "house" program in 5.3.

You can add additional classes or modify existing classes.

The main program is a "controller" class only.

The program must be interactive.

There must be one interactive feature, besides lighting the windows and displaying a count of the number of lit windows, and it must be changing the color of the house.

The user MUST be able to click on a window and have that window "light up" if it is dark or "turn off" if it is lit. A count of the number of lit windows must be displayed on the screen.

There must be at least three pseudo-buttons built with a button class. Each will provide one house color effect on the house.

Any "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H14 30 points due Wednesday 11/13/02

Write a program to have an array of objects. The program will have at least four classes; a controller, a list manager, a button class, and a graphical object class. It is expected you will use previously written object and button classes. The user will be able to add objects to the screen display at a selected location by clicking with the mouse. Buttons will be provided to allow the user to change size of and move selected objects. Must be able to delete selected objects. Bonus points will be given to programs which allow the user to "drag" an object to a new location using the mouse. Bonus points will be given to programs properly incorporating a "button manager" class.

Put the completed project in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet. Remember, at this time it may be necessary to use Internet Explorer to run the applet.

Requirements include:

Author's name and program "title" in a comment at the beginning of the program.

There must be at least four classes: controller, list manager, graphics "thing", button.

The list manager MUST use an array of the graphics objects.

You can write code for "new" classes or modify pre-existing classes.

The main program is a "controller" class only.

The program must be interactive as described above.

The "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility, but you can use the AButton class from the text.

Barriers must be used to keep changes from becoming unreasonable.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H15 20 points due Wednesday 11/20/02

Write a program to manage a list of numbers. The program will have at least three classes; a controller, a list manager, and a button class.

The screen display must include the numbers in a column and a total and average of the scores.

The user will be able to add numbers to the array and then have them displayed on the screen. Buttons will be provided to allow the user to add a number using text fields, delete a selected number, and sort the list by numerical order.

Put the completed project in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet. Remember, at this time it may be necessary to use Internet Explorer to run the applet.

Requirements include:

Author's name and program "title" in a comment at the beginning of the program.

You can add additional classes or modify existing classes.

The main program is a "controller" class only.

The program must be interactive as described above.

The "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility.

Barriers must be used to keep changes from becoming unreasonable.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.

H16 50 points due Wednesday 12/4/02

**** SEE NOTE REGARDING SOURCE CODE****

Write a program to have an array of objects which contain names and numbers. The program will have at least four classes; a controller, a list manager, a button class, and an Person class. The Person object will contain an individual's first name, their last name, and a score.

The screen display must include the names and scores in columns and a total and average of the scores.

The user will be able to add objects to the array and then have them displayed on the screen. Buttons will be provided to allow the user to add an object using text fields, delete a selected object, edit a selected object using text fields, sort the list by last name and sort the list by score.

Put the completed project in your personal folder on Ellerbruch.nmu.edu and link it to your link page. Make sure it works over internet. Remember, at this time it may be necessary to use Internet Explorer to run the applet.

**** NOTE REGARDING SOURCE CODE ****
Remove the source code links from the HTML file. The source is NOT to be available over internet. Put your source files in a folder in the H16 folder with some name which will make it clear that it contains source code , but will not be readily guessed by others (include spaces and "funny" characters in the folder name.)

Requirements include:

Author's name and program "title" in a comment at the beginning of the program.

You can add additional classes or modify existing classes.

The main program is a "controller" class only.

The program must be interactive as described above.

The "buttons" must be built using techniques shown in class. You are NOT allowed to use Java's built-in button facility.

Barriers must be used to keep changes from becoming unreasonable.

The form and format of the program must follow techniques described in class.

HTML must be standard HTML.


Links

CS120 Programming 1 Home Page

Ellerbruch Web Site Home Page

Northern Michigan University


L. W. Ellerbruch: LELLERBR@nmu.edu.