Author Topic: Java Help  (Read 2292 times)

0 Members and 1 Guest are viewing this topic.

KoRo

  • Fat, Emo Robot
  • Centurian Lord
  • ********
  • Posts: 3,437
  • Reputation: +14/-6
Java Help
« on: June 18, 2008 06:58 pm CDT »
I'm forking pissed off. My code compiles, but it doesn't run correctly. I've spent 6 hours straight, without a single break, going through it all line by line, and everything checks out according to how I think it should work. But it simply isn't.

I've used the debugging option on my compiler, and it seems like the program just skips whole sections for no reason at all.

I'm specifically trying to build a String array and have the program store a String to that array each time the program loops. When it's done, it's supposed to display all of the String values you put in, but it doesn't. Looking back, it's as if the program completely skips the part where it's supposed to save the value to the array.

I'm out of options at this point, and i can't figure out for the life of me what the fork is wrong with this. And it's due in 7 hours.

http://pastebin.com/df0d9bdc
http://pastebin.com/d7da93bd3
http://pastebin.com/d1d87af1b


There are multiple problems all arising from that 3rd file. The first one is just my loop controller (called Lab10), and it isn't very important. The second file is the bulk of the program (called Foreign); it stores all of the methods. The first two files work PERFECTLY FINE with each other; if you take out all references to the third file, the program runs without a single hitch.

But when you include the third file (a subclass of the second file Foreign, called Lab10Date), the whole thing goes to hell. In addition to all the original functions, Lab10Date is supposed to Prompt the user to enter a date, then that date is supposed to be saved to an array that was previously created. But like I said before, the dates don't seem to be saving, and I can't figure out why.

Can anyone help?



*Edit* 10:00pm
Posted updates of the code. There are two major problems that need fixing:

1) The inputted values are not being calculated. The program completely skips the method that makes all of the conversions.

2) The date is not being show properly. Despite the "for" loop in the 3rd file, it will only show the LAST date to be entered.
« Last Edit: June 18, 2008 11:51 pm CDT by KoRo »

Kyrie

  • Orb Member
  • Uber Menace
  • ***
  • Posts: 1,014
  • Reputation: +5/-4
Re: Java Help
« Reply #1 on: June 18, 2008 10:09 pm CDT »
I'll take a look in a little bit, but I haven't worked with java for like a year.







Kyrie

  • Orb Member
  • Uber Menace
  • ***
  • Posts: 1,014
  • Reputation: +5/-4
Re: Java Help
« Reply #2 on: June 19, 2008 05:56 am CDT »
I've got it a bit farther along than you had. It's not exactly how it was outlined in your assignment, but this method has it all working and with the dates. You can get it to look more like the version in the assignment, but you lose the dates like before.

I'll go over it with you on MSN later today; maybe with the sleep you've gotten and the few changes I made you can get it working.