0
kirrz

Is anyone good at Java? Desperate!!

Recommended Posts

I have this assignment, I've written the code.. the output is not right. It's doing everything but it's just calculating wrong answers..
I'm so stressed because it's due in 3 hours and the marking criteria is - "the code will be automatically tested, if your code has inconsistent outputs you will automatically receive a mark of 0. there will be no manual re-marking."

The code & description of the problem is located at http://forum.java.sun.com/thread.jspa?threadID=741685&tstart=0

Please please please please please if you know what I'm doing wrong help me! Please!!!!

Share this post


Link to post
Share on other sites
In my assignment sheet we have a sample for input.txt and what is supposed to come up. I'm getting binaries up but they're not what they are supposed to be.. I think somewhere in my code the conversion between integer<-->binary is messed up. I just don't know where and I don't know how to do it...

I haven't tested it against anything else.. Also with the sample file for the second part it is supposed to be error free but it is showing up as an error. So that means both sections of the code aren't working properly because they've been individually tested...

Share this post


Link to post
Share on other sites
It's a while since I did any Java. How confident are you about the "n = n/2" in toBinaryString? It looks like you're relying on it to round down, are you sure that's what it's doing?

fromBinaryString looks to me like it'll work.

Gus
OutpatientsOnline.com

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0