Graphic by Keith Ohlfs |
|
There are 3 pieces to this problem set: the prelaboratory assignment, the laboratory assignment and the homework assignment. You are required to do all three parts. We recommend that you do the prelaboratory assignment before your lab section, the laboratory assignment during your lab section and the homework assignment after completing the prelab and lab assignments.
Prelab Assignment: Although it is required that you complete the prelab, you are not expected to turn in any materials for the prelaboratory assignment.
Laboratory Assignment: Save the modified version of BuggleName.java in the ps1_programs folder to be turned into your drop folder with the other homework files. Turn in a hardcopy of the modified BuggleName.java file.
Important Note: Pay careful attention to upper and lower case letters in the filenames.
Homework Assignment: Save the modified Writing.java and Rings.java files in the ps1_programs folder to be turned into your drop folder. Turn in a hardcopy of the modified Writing.java and Rings.java files.
Put the ps1_programs folder containing the completed laboratory and homework source code into your ps1 drop folder on the cs111 server.
When submitting your hardcopies, we ask that you turn in only one package of materials. Please staple your files together with a cover page, and submit your hardcopy package by placing it in the box outside of Jennifer's office (E104, directly across from E101).
IMPORTANT NOTE - Once you have used Fetch to upload a file to the cs111 server, you should be sure to doublecheck that the file was actually uploaded. You can do this in Fetch by verifying that the file is now listed in your directory. Not only should you check that the file is listed, but you should check that it does not have a size of 0K. If the file isn't listed or if the size for the document is 0K, this means that there was an error in transferring it via Fetch and you must re-upload the document. When transferring a folder, you should check that its contents have been uploaded correctly. That is, you should be sure to check that every single file that you wish to submit has been uploaded correctly. Often times, although not always, you will see a message "Connection Failed" when there is an error in transferring your files.
ANOTHER IMPORTANT NOTE - It is your responsibility to keep a personal back-up of every file that you submit electronically until you have received a grade for the assignment.
Please read the documentation on the CS111 server. Also, browse the documentation page to familiarize yourself with other documentation for the course. In particular, you should familiarize yourself with the documentation for Netscape, Fetch, email, FirstClass, and backing up your floppy disk.
In lecture you were introduced to Buggleworld. In this world you can create "Buggles" that can move in different directions and draw onto their grid world. Today in lab you will learn how to use the Symantec project manager to modify code that uses Buggles. We will first download some pre-written programs, BuggleName, Writing and Rings, from the download subdirectory of cs111 on the cs111 server.
1) First, download the folder, ps1_programs, from the download directory for cs111. This folder contains four java source files (BuggleWorld.java, BuggleName.java, Writing.java and Rings.java), three html files (BuggleName.html, Writing.html and Rings.html), many class files and one project file. Make sure all the icons are displaying the proper images (e.g. a coffee cup on the class files). If they are not, download the fetch preferences and try again.
2) To run the BuggleName program, take the following steps.
In this portion of the lab, we will write the code for 5 buggles to write out Bobby's name, "BOBBY", as shown:
First, we will change the code together, so that bobby buggle draws the letter "B".
Now that you've had a chance to modify and debug some code, it's time to try it on your own. Modify BuggleName.java file so that bobby draws the "B" as before, and becky draws an "O" as in the above image. Then create three new Buggles, bonnie, bertie and belinda to write out the final three ones as shown above. Make sure your buggles end up exactly as shown on the image.
In BuggleWorld, the Buggles have all become very excited about their newfound ability to write, which you provided them in the laboratory part of this assignment. However, they are sad that it took the efforts of five buggles working together to write five letters. This is not ideal if one of them would like to write a note to another. Not only this, but becky, bonnie, bertie and belinda worked very hard writing bobby's name and they are tired of his uppity attitude now that his name is in BuggleWorld. They would like to work for themselves now, and have bobby write his own name! As a result, they have hired you as a consultant, to help individual buggles write more than one letter. Your job, is to make the buggle, bobby, write the letters "BOBBY" as shown above, without the help of the other buggles, becky, bonnie, bertie and belinda.
Because bobby gets tired if he has to make too many large jumps around BuggleWorld, he has requested that you show him how to write "BOBBY" without invoking the "setPosition" method. He is perfectly happy to lift his brush up (by invoking the method "brushUp") and put his brush down (by invoking the method "brushDown") so that he will only leave a trail when required. He also likes the idea of writing with multiple colors, so he would like to write the first B in red, the O in blue, the second B in yellow, the third B in black and the Y in green.
In the Buggles folder there is a file, Writing.java. This applet creates buggle bobby and sets his color to red.
Modify the Writing.java code so that bobby draws the letters "BOBBY". The resulting letters should look as follows:
.
You must conform to the following rules:
In BuggleWorld, the buggles regularly hold competitions in which they run the hurdles or traverse obstacle courses. Because they enjoy these competitions so much, they have decided to hold the first Buggle Olympics. To prepare for the big event, they have decided they need an appropriate symbol. They like the idea of interlocking rings, but due to the constraints of BuggleWorld, their rings have to be squares instead of circles. They have designed the following logo for their olympics:
Five buggles--becky, bobby, bertie, billy and benny--have agreed to help out in drawing the rings. becky wants to draw the red ring, bobby the yellow ring, bertie the blue ring, billy the cyan ring and benny the magenta ring. Each would prefer to draw only in one color and not change colors in the middle of their ring. Furthermore, they would prefer not to have to put their brushes up and down while drawing their rings. They have asked you to help them choreograph their movements so that the rings get drawn the correct way, with each ring overlapping the others as shown above.
Your assignment:
The file "Rings.java" contains the initial set-up for drawing the olympic rings. becky, bobby, bertie, billy and benny are all in the appropriate starting position and are the appropriate color.
Now, you must fill in the java code to move each buggle around a 7 x 7 square, so that the rings overlap each other as shown. You must conform to the following rules: