Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW1-Spring08

Ask questions on homework 1 here:

Question: Is the deadline still Friday at 7pm? T-square still isn't up

Question: Should our homework return 2 pictures with one modification made on each, or should it return 1 picture with two modifications made?

Question: How do we find out who our grading TA is or should we just put which section we are in or is it both TA's in the recitation? I can't find it...

Question: I'm having trouble figuring out how you build the code, like grayscale or decreaseRed. I'm sure that's the point of this homework, but is there anywhere where we can see more examples?

Question: How do I get my code to run through every pixel in the picture instead of just one pixel? Isn't there a certain line of code to use? Is that what "Pixel[] getPixels()" is for? Even if it's not, can you explain what that piece means?
Question: Is it normal that I have to open and compile in addition to my code before I can open any pictures/getMediaPath?

Question: After copying and pasting something into my code (before modifying it) I get an error for the line "public void verticalLines()" saying that it's an "illegal start of expression." Translation?

Question: I made sure my 'verticaLines' was within the class file, but I'm still getting the "illegal start of expression" error. What should I do? :(

Question: Thanks! ... but concerning the Filechooser question, how do I fix it?

Question: Since we have to use FileChooser.getMediaPath(), do we include a picture name in the parenthesis, or will the grading TA do that? Also, will our TA be setting the MediaPath?

Question: I keep getting an error message that says I have no 'main' method in 'AdvancedPicture'. This is that part of the code...what am I missing?
 public static void main(String [] args) {
    AdvancedPicture ap1 = new AdvancedPicture(FileChooser.getMediaPath("bigben.jpg"));
    AdvancedPicture ap2 = new AdvancedPicture(FileChooser.getMediaPath("shops.jpg"));

Question: For some reason my filechooser is not working properly my code looks like...
    AdvancedPicture ap1 = new AdvancedPicture(FileChooser.getMediaPath("arch.jpg "));
    AdvancedPicture ap2 = new AdvancedPicture(FileChooser.getMediaPath("eiffel.jpg "));
The error I get is a picture popping out saying "Couldn't load D:/cs1316/mediasources/eiffel.jpg" which is weird because I don't have a D drive. Also I know everything else works because when I hardcode the file path everything works properly.

Question: Do we need to put into our code the "public String toString() {}" part?

I compile my program with no problems, but when I try to run it, I am getting "Couldn't load the file D:/cs1316/mediasources/swan.jpg". I compiled the file, set my media paths according to the instructions, and don't know what can be going wrong. I'm using a Mac, if that may hold any bearing as to the source of the issue? Any suggestions?

Same deal...if I type "java AdvancedPicture" in the Interactions Pane, I get "Couldn't load the file D:/cs1316/mediasources/swan.jpg", however, if I compile again and click the run button, I get "Couldn't load the file nullswan.jpg". BAH! =(

Question: Could someone clear up what the terms "double" and "floating point number" mean?
I keep getting the error "cannot find symbol; sumbol : constructor AdvancedPicture(java.lang.String)" and it marks the line
AdvancedPicture ap2 = new AdvancedPicture(FileChooser.getMediaPath("swan.jpg"));

What does it mean?

When I use the getPixel(x,y).setColor(, it gives an error, saying that "Color" cannot be found.

Do we need to list our TAs as collaborators if we used the code they wrote in recitation as a big starting point for our homework?

Question: my for loop looks like this
for (int index = 0; index < pixel.length; index++)
and I keep getting the error "cannot find symbol variable length."

Question: I changed it, and now it says "cannot find symbol variable pixels". Ho hum...and it's the only error I have. It would suck if I got a bad grade because of something stupid like this.

Question: What is a NullPointerException?

Link to this Page