This homework requires skills from Chapter 2, Chapter 3, and Chapter 4 up to page 98.
Note, besides writing the code
there is an interview process required for this PSA.
Details at bottom after turn-in instructions.
To create this program you will need to do the following:
drawShape which takes in one integer parameter: size.
drawShape method do something.
In Dr. Java, open a new file, and copy this code into it. Save it in the PSA3/bookClasses directory. Add the lines inside the main method necessary to do the following:
Note: Please use the term "Shape" not the shape you use. We will be looking specifically for the method drawShape and for the file CreateShapes.java.
You are required to use four turtles and have each sized shape a different color. However, feel free to be creative. The only shapes that are "not allowed" are squares (too easy :). You can use any shape you want (e.g. not all the "sides" of your shape have to be the same size... (ask on webboard if you don't get the idea...).
Method 1: createSolid
createSolid. You will add a method to Picture.java (be sure to use PSA3/bookClasses/Picture.java) that creates a "solid canvas" of a particular
color. This method takes three parameters -- which are the desired red, green,
and blue component values -- IN THAT order.
Method 2: createPattern
createPattern.
This method
should set every other pixel in the picture to "black" (that is pixels at indices
0,2,4,6,8, etc.) and the other pixels to the color passed in as parameters
(in the same red, green, blue format as in createSolid). That is, pixels in the
picture's pixelArray with odd indices (1,3,5,7, etc.) should be set to the color
values passed into the method as parameters.
Testing your methods (in an application):
PSA3B.java where you will write an application to test your methods.
Start by copying in this
code. Save the file in PSA3/bookClasses.
When you are ready to turn in your homework, first open a terminal window by right clicking on the empty area of your computer's desktop (have to use
lab computers or remotely connect from your home computer using SSH or Putty)
and select "Open a New Terminal". Then, run bundlePSA3 from your PSA3/bookClasses directory.
4 files are required to be submitted for PSA3:
Turtle.java
CreateShapes.java
Picture.java
PSA3B.java
-bash-2.05b$ cd ~/PSA3/bookClasses
-bash-2.05b$ bundlePSA3
Good; all required files are present:
Turtle.java
CreateShapes.java
Picture.java
PSA3B.java
Do you want to go ahead and turnin these files? [y/n] y
OK. Proceeding.
Performing turnin of approx. XXXX bytes
Copying to /home/linux/ieng6/cs8f/turnin.dest/cs8wxx.PSA3
.
Done.
Total bytes written: XXXX
Please check to be sure that's reasonable.
Turnin successful.
Make sure the Turnin is successful, otherwise we won't receive your submission! . If you want to make changes after you've turned in your homework, make the changes and run bundlePSA2 again. The program will warn you that a "previously turned-in file exists" and ask if "you wish to over-write this existing file". Respond in the affirmative by typing y and pressing the Enter key.
10% of your grade on this assignment will come from an interview you will have with one of the tutors during Open Lab Hours. You have 48 weekday hours after the electronic turnin deadline to get your interview done. The deadline for the interview for PSA3 is Thurs Jan 22 (theoretically at midnight, but actually by the end of the last tutor hour scheduled). Remember, the tutors may be busy after 4pm helping CSE8B students
You get an interview by going into B260 during a scheduled tutor hour. Find the tutor, ask them if you can interview for the 8A PSA. If they have others who are waiting for interviews, your name will go on the end of the list of people waiting. Interviews take about 5 minutes each. It is your responsibility to go in early enough that you can get your interview completed. If everyone waits until the last hour on Thurs, this will not work.
For the interview you will need to have a copy of your team's assignment in your account. If you are using your partner's account to submit the files, make sure you email them to yourself and save them under your account so that you have them available for the interview. The tutor will ask you to log in, change to the directory where your work is and then to follow their directions. They will ask you to run your program to show that it works, open files in Dr. Java (or your favorite editor), and ask you questions about HOW your code works. Additionally, they may question you as to how you would (theoretically) make small changes to the program to have it do something slightly different. You will not actually be required to change your code.
Learning to be able to explain your problem solving process and discuss code with another human being is a very important professional skill. We hope that this process will help you develop this skill.