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

Questions on HW0-Spring08

Ask questions on homework 0 below.


Question: I ran this line of code:
  FileChooser.setMediaPath("C:/CS1316/mediasources/");
but made a typo on the path, so that when i ran:
  Picture p = new Picture(FileChooser.getMediaPath("swan.jpg"));
  p.show();
I got an error. I went back and fixed the typo and then got the following error:
Error: Redefinition of 'p'
I tried using "clear" (as in, clearing the variables in MATLAB) but that doesn't seem to be a valid command in Java, so I closed DrJava and then started it again. That worked, but I'm sure there is an easier/right way to do it when something like that happens. Anyone know?

Question: I keep getting an error: "No compiler is available." I've tried several things and nothing seems to work.

Question: How do we save the stuff we typed in the interactions pane to turn in for homework?

Question: I have followed exact codings on HW0, but Java keeps telling me "class, interface, or enum expected"

Question: Where exactly on TSquare are we supposed to submit the assignment?

Question: A quick question on formatting code - the code for hwk 0 is indented and is nice and pretty (the actual assignment, that is), but I'm not sure the quick way to do that kind of formatting (the tab button doesn't seem to do too much). I can move it around with spaces and backspaces but I'm sure there's a better way. What is the proper way to lay out code? Also, I just realized I probably sent you a half a dozen emails. Sorry TAs, my bad.

Question: I'm having trouble installing Dr Java on my Mac. I downloaded all the files and I can see the icon, but can't get it to start. Is there another application, similar to Dr Java, that I can use?

Question: When I try to run the line of code (after defining the integers a and b) " int sum = a + b;" I get an error message: [error: redefinition of "sum"] ?

Okay, everything ran fine until I tried to compile FileChooser.java and Picture.java. It says there is no associated file, and then something about no compiler. I don't have to re-install everything, do I?
The simple addition and all that worked fine. When you say "open up the files and view the actual source code" do you mean the stuff that comes up in the big window on the right?
Yep, the code shows up on the right. How do you know if the files compiled? I had tried setting the media path before and it gave me the error "undefined class 'FileChooser'" and brought up a window called "auto import class."
I have Dr. Java installed and running, but I am having problems compiling the files. How do I do that? Thanks.

Help. What do I turn in for this homework? Do I have to or will you not be grading it?

Also, when I type 'int a = 6' and then try to add them, it doesn't show me any result or answer in the window. Where am I supposed to look? It is not giving me an error either, so I don't know what is wrong.

Ok, I hope people are still asking questions on here. When I try to compile, I get the error saying it cannot read zip file entry. I'm sure that I'm not trying to read a zip file.

That's what I'm saying. I did extract them. That's why I don't understand the problem. Also, with the picture.java, when I hit compile it opens PictureExplorer.java, SimpleSound.java, and SoundExplorer. java and gives me a whole bunch of warnings.

Link to this Page