Extend our PageGenerator class to generate a web page of your personal design. Your generator must add at least two new features to the page. Here are some possible features you might add:
If you have ideas of other features that you would like to add, just ask!!
Additionally, you may also modify the existing methods of the generator to rearrange the page, change its presentation, etc. (Such changes won't count toward your assigned quota of two unless they are substantial and I approve them as such in advance.)
This assignment is worth 20 points.
Extra Credit Opportunities
Add more than two new features... (2 points)
Any other ideas?
Deliverables
By the 4:00 PM on Saturday, December 9, submit a zip file of a directory that contains these files:
For this assignment, you do not need to submit a printout. We will grade from the electronic submission alone.
Write a class named GraphicsInterpreter that reads a sequence of graphics commands from a text file. The class should have a method named interpret that
The method should create a blank 640x480 picture on which to drwa.
There are at least three kinds of commands:
The line command draws a straight line. For example, "line 10 20 300 400" draws a line from (10, 20) to (300, 400).
The circle command draws, yes, a circle. For example, "circle 100 200 50" draws a circle whose center point is (100, 200) and whose radius is 50.
This assignment is worth 20 points.
You can use this main method for your class:
public static void main( String[] args ) { GraphicsInterpreter artist = new GraphicsInterpreter(); String filename = FileChooser.getMediaPath( "commands.txt" ); Picture p = artist.interpret( filename ); p.show(); }
Extra Credit Opportunities
Make it so that we can initialize a GraphicsInterpreter with a particular picture. If the object is created with a picture, then it draws on the given picture. If not, it uses a blank canvas. (1 point)
Create a commands.txt file that produces a picture that does something useful. For example, I could imagine a sequence of commands that create a poster to advertise a meeting. (1 point)
Deliverables
By the 4:00 PM on Friday, December 1, submit a zip file of a directory that contains these files:
For this assignment, you need to submit only one printout -- GraphicsInterpreter.java.
Quick Overview
Your task this week is to write your first new class, one that represents simple slideshow objects. A slideshow consists of a collection of pictures to display and a collection of sounds to play. In the simplest form of slideshow, your program will play one sound file for each picture it displays.
Details, Details
How We Will Grade Your Assignment
This assignment is worth 20 points.
We will...
Extra Credit Opportunities
None yet. But I will appreciate demonstration slideshows that tell a nice story!
I am also inclined to consider extra credit for a slideshow that offers a second way to display a slideshow, where each sound is accompanied by multiple pictures, say, four pictures shown during a longer sound clip. A simple version of this would have n > 1 pictures for each sound, and each picture is shown for sound.length/n samples. If you want to give this a try, contact me!
Deliverables
By the 8:00 AM on Thursday, November 16, submit these files:
For this assignment, you need to submit only one printout -- Slideshow.java. You do not need to submit printouts of Picture.java or Sound.java (or of your images and sounds) -- but you must submit them all electronically.
You must submit your Picture and Sound classes, even if they don't contain any methods other than the original versions from your CD. This way, we don't have to worry about problems with different versions of those classes.
This assignment consists of two tasks. Put both methods in the same Sound class, along with any helper methods you create.
Task 1
In Program 74, Guzdial and Ericson splice the word "united" from later in the preamble to the Constitution into the earlier phrase "We the united people...". Let's emphasize that word by making it maximally loud for the sound file.
Modify the method to normalize the spliced-in "united" in "We the united people...".
Task 2
Compose a sentence that I never said using the sound clip of The Voice of CS I. That sound file has a lot of empty space and white noise in it, so there is plenty of room for you to rearrange words around, splice words in, and otherwise "doctor" the audio.
Write a method named doctorTheVoice() that loads that sound file using getMediaPath(), modifies it, and returns the modified sound as its result. Make at least three different changes to the sound. You may use words from the mediasources folder, the clipped but high-pitched version of my voice, or even words you record on your own. But the bulk of the result should be my words.
Be sure to include a pause between words so that we can hear them distinctly. (I suppose that running a couple of words together could for an interesting effect, so I'll give leeway where the sound is interesting!) 1/10 of a second is usually a reasonable pause. Recall that sample values of 0 generate silence.
For example, I applied....
How We Will Grade Your Assignment
This assignment is worth 20 points.
We will...
String silence = FileChooser.getMediaPath( "sec3silence.wav" ); Sound target = new Sound( silence ); target.splicePreamble(); target.play();Sound theDoctorsVoice = silence.doctorTheVoice(); theDoctorsVoice.play();
Deliverables
By the 8:00 AM on Tuesday, October 31, submit these files:
Quick Overview
Your task this week is to write a method that creates a comic strip using pictures of your choosing. The strip must have at least four frames in it. Here is a sample, a two-frame comic strip from the authors of our textbook.
After deciding on images and a theme, you will want to plan ahead a bit, to design the layout of your comic strip. Here is an example of the planning that the authors did while creating their sample strip.
Details, Details
How We Will Grade Your Assignment
This assignment is worth 30 points.
We will...
ComicStrip comic = new ComicStrip( width, height ); comic.createStrip(); comic.show();
Extra Credit Opportunities
If your comic strip makes sense -- that is, isn't just a bunch of pictures thrown together, but actually "tells a story" -- then you will eligible for two (2) extra-credit points.
If your comic strip uses a background picture from some image file in at least one of the frames, then you will be eligible for four (4) extra-credit points.
Deliverables
By the 8:00 AM on Tuesday, October 17, submit these files:
This assignment consists of two tasks.
Task 1
Add a lakeEffect() method to the Picture class that takes no arguments. lakeEffect() makes a new Picture that is twice as tall as the original. Into the top half of this new picture it copies the original. Into the bottom half it mirrors the original, but with a twist... Each pixel is mirrored by the average of its left and right neighbors.
Pixel (x,y) will be mirrored by a pixel whose color is an average of pixels (x-1,y) and (x+1,y). Pixels on the end -- pixels (0,y) and (width-1,y) -- have only one neighbor, so they are mirrored by a pixel whose color is an average of pixel (x,y) and its one neigbor.
For example, I applied the lakeEffect() method to the sundial image used above and received this resultant image.
Apply your lakeEffect() method to an image or two of your choosing. Cool effects are appreciated!
Task 2
Add a fogEffect() method to the Picture class that takes one argument, an int named threshold that indicates a level of light. threshold must be in the range 0..255, inclusive. fogEffect() turns all pixels lighter than threshold to grayscale, to simulate fog.
For example, I applied a fogEffect(150) filter to the mediasources' beach image and received this resultant image. When I applied fogEffect(125) filter to the mediasources' church image, I received this image.
Apply your fogEffect() method to an image or two of your choosing. Do you notice anything about what images your method works best on?
Deliverables
Submit one Picture.java file containing your two new methods, plus whatever "helper" methods you create..
By the 8:00 AM on Tuesday, October 3, submit these files:
NOTE: The assignment is now complete. I decided to assign just one method to write, which cuts the assignment roughly in half. As a result, let's return to the originally-planned due date, Tuesday, September 26.
This assignment consists of a single task.
Add an embedImage() method to the Picture class, which takes four arguments:
embedImage() copies a square of that width from the source image, beginning at (x,y), into the lower righthand corner of the receiving image. It also draws a black border around the inset image that is three pixels wide. For example, I embedded a 185x185 region beginning at (70,15) from this image of a sundial into the mediasources' butterfly2 image and produced this resultant image.
Deliverables
By the 8:00 AM on Tuesday, September 26, submit these files:
You do not have to submit printouts of your images.
Some of you completed Homework 1 but had some trouble submitting your files.
Others of you had trouble completing part of the assignment and would benefit from some extra time to work on your loops.
So: Here is a second chance. You may submit files again, or make changes and additions to your files and submit.
By the 8:00 AM on Thursday, September 14, you may submit -- or re-submit -- any of these files:
Be sure to follow the homework submission instructions for the course! Because we do not have a regular class on Thursday, you may submit printouts of your grayscale-experiment.txt and Picture.java files in one of two ways:
I'll be available between now and Thursday at 8:30 AM or so, so please ask any questions you may have -- I'll do my best to help.
This assignment consists of two tasks.
Task 1
Use any color image of your choosing. You may select from the images in the textbook's mediasources/ folder, the images I've used in class, or an image you obtain from somewhere else. In any case, document the source of your image.
Create several different grayscale versions of your image, by experimenting with the intensity value you set each pixel to. One way to come up with some interesting combinations is to weight the red, green, and blue components of a pixel differently when creating the intensity value.
Write up a short description of your experiments in a text file (not a Word document!) named "grayscale-experiment.txt". Be sure to say which of the grayscale versions of your image seems to be the most faithful to the original -- and why you think that version looks better than the others.
Submit your "grayscale-experiment.txt" file and all of your images.
Task 2
Add a method to the Picture class that draws a black border around the inside of the image. For example,
Then write a method that adds some flourish of your own choosing to this idea, say, a different color for the border, or a thicker border. Remember -- this method should work for any picture!
Submit your modified "Picture.java" file.
Deliverables
By the 8:00 AM on Tuesday, September 12, submit these files: