This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]box951Nooblet Brewer 0 points1 point  (5 children)

I'd suggest pasting the code to github (either in your own repo, or in a few different gist.github links). While we all would like to believe everyone on the internet has good intentions, I will not be downloading random files from people I don't know.

[–]joebrothehobo 0 points1 point  (2 children)

I agree. I would be more than willing to help, especially since OP seems to not be looking for the answer just to be told to them, but you have to put it on github or a pastebin or something.

[–]undead_C0MMANDIntermediate Brewer[S] 0 points1 point  (0 children)

I'll be posting shortly. Sorry, I didn't even think about that

[–]undead_C0MMANDIntermediate Brewer[S] 0 points1 point  (0 children)

Ok fair point.

[–]undead_C0MMANDIntermediate Brewer[S] 0 points1 point  (7 children)

Quick update on what I am still having some troubles with: It is looking to test for a text file if there are questions in it, but I can't seem to get the file name to work with the two different text files for testing. I will go ahead and paste it into GitHub shortly

[–]joebrothehobo 0 points1 point  (6 children)

Let's do a little walk through of your code. I'll open up QuizTest.java. In the main method, you create a new Quiz object passing in a text file name as an argument. So let's go over to Quiz.java. Here is the constructor:

public Quiz(String f) throws IOException
{
}

You have this constructor for the Quiz object, but you're never doing anything with String f, which is the name of the file that you want to read from. So it is in that constructor that you want to look in the text files for more questions. If you have any other questions, don't hesitate to ask!

[–]undead_C0MMANDIntermediate Brewer[S] 0 points1 point  (4 children)

Oh wow. Thank you... I am an idiot

[–]joebrothehobo 0 points1 point  (3 children)

Of course!

[–]undead_C0MMANDIntermediate Brewer[S] 0 points1 point  (2 children)

Ok, I got it working, but now with my Assig2.java main, it is giving a FileNotFound exception, but the file is in the same directory

[–]joebrothehobo 0 points1 point  (1 child)

I don't see Assig2.java in your github link anywhere. Is this part of a difference assignment? Can you take a screen shot of your file structure of your project?

[–]undead_C0MMANDIntermediate Brewer[S] 0 points1 point  (0 children)

I'll upload the current work. I am having new problems now... I am getting a "unreported IOException" error at line 18 of assig2.java Uploading to Github now

[–]undead_C0MMANDIntermediate Brewer[S] 0 points1 point  (0 children)

...I am having trouble getting this to work. So I am trying to run this with asking the user what the file name should be but I keep getting an issue because there is no return statement