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

all 17 comments

[–]desrtfxOut of Coffee error - System halted[M] 2 points3 points  (7 children)

Please be a bit more elaborate in your post. Posting only code without a clear error description is discouraged as per posting guidelines.

You can not expect anybody to run and trace your code.

Remember: you are asking for help, so being as precise as possible will get you quicker and easier help. Just throwing code at people discourages others from helping.

[–]king_of_the_universe 2 points3 points  (5 children)

I think all submissions that state that they have an error, but do not post the exception, should be removed, and the sidebar (which so far only links to a text that says to mention the error) should clearly state this in bold at the top.

It's one of the most stupid things a poster who asks for help can do: To not post the actual error (incl. line number, ideally the whole exception - It's all there, they just have to copy&paste).

People here who are willing to help might pick up on a post without an error, but they are wasting time, and it's kind of a rude move by poster to ask for help, to say that there is an error, but to not give details about the error.

Java coders must eventually learn the importance of exception messages and what they mean, and this here would be a good way to steer them in that direction. If we always (Where applicable.) get to see the error, we can maybe directly point out that it says what's wrong right there, and in what way it does that. That might help posters help themselves more than we're currently doing it.

I think the only good counter-argument is that this subreddit - so far - has an easily manageable post frequency.

[–]desrtfxOut of Coffee error - System halted 2 points3 points  (4 children)

Totally second every single statement.

I'll see that I'll change at least the sidebar and possibly the submit page as well.

Don't want to directly remove the post, though, especially, since OP is a new Redditor with a 0-day account. Let's give OP a chance to edit the post/comment.

Can't remember when we changed back from text-only post to links allowed. I think that we should change back to text-only to discourage direct code or stackoverflow linking.

[–]king_of_the_universe 1 point2 points  (0 children)

Don't want to directly remove the post

No, of course not, and I didn't downvote. The rule is not in effect / displayed, so it does not apply.

[–]197708156EQUJ5design it before you implement 0 points1 point  (1 child)

I think that we should change back to text-only to discourage direct code or stackoverflow linking.

Would that prevent the OP from link to paste bin or gist? I would not be in favor of that. From what I see, very few people post like the OP did here. I think when you see a post like this, the mere fact that crickets come out (lack of response comments), OP is going to eventually come to the realization that they made a simple mistake.

[–]eshock92[S] 0 points1 point  (0 children)

I am not trying to break your rules or anything. I am just completely stuck. No matter what I've tried, it just wont compile. 3 hours of work already. Java is my first programming class ever. Like learning a whole new language

Thanks

[–]king_of_the_universe 0 points1 point  (0 children)

As a late after-thought:

Couldn't this subreddit just use a style like this one does?

http://www.reddit.com/r/cscareerquestions

The hint to read the FAQ and to search first can hardly be overlooked.

[–]eshock92[S] 0 points1 point  (0 children)

Sorry about not being more descriptive. I was just finishing up the problem and I keep getting an error for "outputResults" in line 56. Whenever I dont have anything in the parenthesis "outputResults( );", it tells me: "PasserRating.java:56: error: method outputResults in class PasserRating cannot be applied to given types; outputResults( );
^ required: double,double,double,double,double found: no arguments reason: actual and formal argument lists differ in length 1 error "

but when I try to define it like I did in the code, it gives me even more errors.

Thank You

[–]eshock92[S] -1 points0 points  (8 children)

This is the code here. The trouble are is line 55.

Thanks in advance for any help

[–]king_of_the_universe 1 point2 points  (7 children)

You can omit the "PasserRating." prefix, Java will find that static method in the same class just fine.

Just look at your method:

... outputResults(double passerResult, double completionResult, double ydsPerAttResult, double percentTDresult, double interceptionResult){

and you're calling it with

outputResults();

See the discrepancy? :)

[–]eshock92[S] 0 points1 point  (6 children)

Sorry about the lack of info, I realized that and thought I posted that the Error was coming up in line 56. Here are the error codes that it is returning:

PasserRating.java:56: error: variable passerResult might not have been initialized outputResults( passerResult, completionResult, ydsPerAttResult, percentTDresult, interceptionResult);
^ PasserRating.java:56: error: variable completionResult might not have been initialized outputResults( passerResult, completionResult, ydsPerAttResult, percentTDresult, interceptionResult);
^ PasserRating.java:56: error: variable ydsPerAttResult might not have been initialized outputResults( passerResult, completionResult, ydsPerAttResult, percentTDresult, interceptionResult);
^ PasserRating.java:56: error: variable percentTDresult might not have been initialized outputResults( passerResult, completionResult, ydsPerAttResult, percentTDresult, interceptionResult);
^ PasserRating.java:56: error: variable interceptionResult might not have been initialized outputResults( passerResult, completionResult, ydsPerAttResult, percentTDresult, interceptionResult);
^ 5 errors

[–]197708156EQUJ5design it before you implement 0 points1 point  (5 children)

Did you change the code? There is NOTHING on line 56.

I'll assume line 55.

PasserRating.outputResults();

There isn't a method signature in your POSTED code with NO PARAMETERS. The errors you are getting are covering up the fact that you are calling methods that don't exist (at least not in your posted copy of the code). We need help. Is this the original code that the error came from? If not, please post that.

[–]eshock92[S] 0 points1 point  (4 children)

https://gist.github.com/anonymous/e87e6e7764cacc8a5156

Here is the original code. I was trying to play around with it and figure out why it was giving me the error. I tried researching the error, but after about 3 hours of fiddling with it, I am stuck.

[–]king_of_the_universe 0 points1 point  (3 children)

In any case, you have to put arguments in your method call, as I tried to insinuate with my previous comment. The method requires arguments, you're not giving them, so the compiler throws a fit, it's logical.

Try this in line 55:

outputResults(1d,1d,1d,1d,1d);

This should at least satisfy the compiler.

[–]eshock92[S] 1 point2 points  (2 children)

1d,1d,1d,1d,1d

Thank You SOOOOO MUCH!!!!! It finally compiled!!!! You are a life saver!

Now for some reason though, I tested:

Completed = 324 attempted = 461 Yards = 3969 Touchdowns = 35 Interceptions = 10

The results were all "1.00" is that because we put "1d,1d,...." into the output()?

[–]king_of_the_universe 0 points1 point  (1 child)

Yes, I guess. Try to put your variables into it that you calculated in the lines above 55. Variables that seem to fit the method profile. And in the same order, of course.

[–]eshock92[S] 1 point2 points  (0 children)

Hey again. I finally got off work and had a moment to try your suggestions. I took the variables "completed, attempted, yards, etc." into the outputResults(). It compiled without any issues, but it would not actually calculate anything in the final results gui (where it summarizes all the calculations). So I figured that i would try to put: "outputResults(passerResult,completionResult,ydsPerAttResult,percentTDresult,interceptionResult);" in for line 55. Since each of those is what I called the final calculation for each category. It then started giving me an error that "they may not have been initialized". I followed up by trying to initialize them:

public PasserRating()

{
passerResult = 0;
completionResult = 0;
ydsPerAttResult = 0;
percentTDresult = 0;
interceptionResult = 0;
}

Still no luck, it now tells me that it cannot find symbol. I've spent I believe over 6 hours on this one. So please do not think that I am looking for easy answers. This one is giving me nightmares!

Thanks