PDA

View Full Version : java experts....



Impreza
01-23-2003, 10:45 PM
please pm, i need help with an error...

Impreza
01-23-2003, 11:27 PM
anyone?

kaput
01-23-2003, 11:29 PM
.

D'z Nutz
01-23-2003, 11:37 PM
Why don't you just post your error here?

Impreza
01-23-2003, 11:40 PM
this is my error...
A1/Bank.java:247: unreachable statement
while (more)
^

i think its around here...

while (more)
{
System.out.println("d = deposit");
System.out.println("w = withdrawal");
System.out.println("b = print balance");
System.out.println("t = transfer funds");
System.out.println("o = open account");
System.out.println("c = close account");
System.out.println("q = quit");
System.out.println();
System.out.print("please choose an option");
ans = (char) Console.in.readChar();
Console.in.readLine();
System.out.println();

switch (ans)
{
case 'd' : doDeposit();
break;
case 'w' : doWithdrawal();
break;
case 'b' : showBalance();
break;
case 't' : doTransfer();
break;
case 'o' : openAcct();
break;
case 'c' : closeAcct();
break;
case 'q' : more = false;
break;
default:
{
System.out.println();
System.out.println("Sorry, unrecognized request.");
System.out.println("please try again or type q to quit.");
}
}
System.out.println("Thank You.");

}
}
}


__________________

D'z Nutz
01-23-2003, 11:47 PM
Yuck! What happens if you put a statement in the while-loop that allows more to be false? Like at the very end of one iteration or something... (Like after the "Thank you")

Impreza
01-23-2003, 11:51 PM
hmm......i have no clue....i am lost...

D'z Nutz
01-24-2003, 12:00 AM
Oops, nevermind. So much for speed reading code! Hahaha!

D'z Nutz
01-24-2003, 12:18 AM
for (i = 0; 0 < max; i++)
acct[i] = 0.0;



???????????????

Impreza
01-24-2003, 12:23 AM
hmmm....wat about the

for (i = 0; 0 < max; i++)
acct[i] = 0.0;

???
thanks for ur help man!! u seem to help me with all my probs that i post! haha

Impreza
01-24-2003, 12:24 AM
this error is killing me..i am soo frustrated i cant think straight

gpomp
01-24-2003, 12:25 AM
Ugh... Java, damn assignment due Monday morning.

D'z Nutz
01-24-2003, 12:25 AM
That should be the source of your "Unreachable problem". Since you'll never get out of that loop, you can never get to the while loop.

for (i = 0; 0 < max; i++) /* zero is always gonna be less than max! */


Should be

for (i = 0; i < max; i++)

Impreza
01-24-2003, 12:27 AM
Originally posted by gpomp
Ugh... Java, damn assignment due Monday morning.

due monday?? isnt it due tomorrow?

Impreza
01-24-2003, 12:32 AM
ok...thx d's nutz, my program can now compile.
but now i have an error when i try to run the program!! aarghh!!

Exception in thread "main" java.lang.NoClassDefFoundError: a1/Bank

does anyone know what this means???
sorry, i am a newbie at java...

D'z Nutz
01-24-2003, 12:35 AM
What's your file called? Should it not be A1/Bank? (with a capital A)

Impreza
01-24-2003, 12:41 AM
my file is called Bank.class,

D'z Nutz
01-24-2003, 12:50 AM
Not sure. Generally you get that mistake when the file cannot be found, such as when you type it incorrectly. It looks like you should've ran "A1/Bank", not "a1/Bank", but I could be wrong.

Anyways, I'm off to bed. Good luck. I've removed your first source code post.

Impreza
01-24-2003, 12:55 AM
Originally posted by D'z Nutz
Not sure. Generally you get that mistake when the file cannot be found, such as when you type it incorrectly. It looks like you should've ran &quot;A1/Bank&quot;, not &quot;a1/Bank&quot;, but I could be wrong.

Anyways, I'm off to bed. Good luck. I've removed your first source code post.
thx!

boi-alien
01-24-2003, 01:06 AM
hey i remember that assignment... making a bank account right?

Impreza
01-24-2003, 01:15 AM
yup!

boi-alien
01-24-2003, 01:20 AM
you finished it yet?!

Impreza
01-24-2003, 01:21 AM
umm...well, i am done the program, but i cant run it for some reason!! it will compile but it wont run!!
r u in compsci?

boi-alien
01-24-2003, 01:23 AM
yup

gpomp
01-24-2003, 01:25 AM
Originally posted by Impreza


due monday?? isnt it due tomorrow?

No, it's due Monday for me...

boi-alien
01-24-2003, 01:26 AM
Originally posted by gpomp


No, it's due Monday for me...
they give you a weekend grace period... at least from what i remember

Impreza
01-24-2003, 01:28 AM
serious?? how do i get the weekend grace period?? do i just ask?

mrmattyk
01-24-2003, 01:28 AM
Computer Science at U of C. That's bullshit you have to convert that pascal program, it's not as simple as you think. Java is case sensitive and just a pain in the ass! :guns:

boi-alien
01-24-2003, 01:30 AM
Originally posted by Impreza
serious?? how do i get the weekend grace period?? do i just ask?
it's proff dependent i think

gpomp
01-24-2003, 01:31 AM
Originally posted by crxboi

they give you a weekend grace period... at least from what i remember



Originally posted by Impreza
serious?? how do i get the weekend grace period?? do i just ask?

Actually, nope...

All my assignments are due Monday morning at the beginning of my lab period.

Impreza
01-24-2003, 01:35 AM
frik...ur lucky..
ya, i thought the assignment was gonna be a breeze...but ya, its a pain in the ass

gpomp
01-24-2003, 01:36 AM
I have some array program due Monday. Dunno what an array is though, might have to figure that out this weekend. :dunno:

boi-alien
01-24-2003, 01:36 AM
Originally posted by Impreza
frik...ur lucky..
ya, i thought the assignment was gonna be a breeze...but ya, its a pain in the ass
heheh first assignment... wait till you get to the solitaire... or the parsing ones :)

Impreza
01-24-2003, 01:38 AM
FUCK!! ur scaring me!! im gonna need major help

mrmattyk
01-24-2003, 01:46 AM
That's why I didn't take Computer Science!
I know some dude in your class who is freaking out too.

boi-alien
01-24-2003, 02:05 AM
i'd stay up to help you but i'm exhausted, good luck with it, just check your syntax, and stuff

D'z Nutz
01-24-2003, 09:23 AM
Shit, you guys a freaking out on 233?? The fun's just getting started!! :rofl:

Did you get it figured out Impreza?

Impreza
01-24-2003, 09:43 AM
welll, it compiles, but i still cant get it to run

boi-alien
01-24-2003, 10:11 AM
Originally posted by D'z Nutz
Shit, you guys a freaking out on 233?? The fun's just getting started!! :rofl:

Did you get it figured out Impreza?

:werd:

Originally posted by Impreza
welll, it compiles, but i still cant get it to run

what does it say?

Impreza
01-24-2003, 10:37 AM
its says this...

Exception in thread "main" java.lang.No Class.DefFoundError: A1/Bank.class

i am in the compsci lab right now if anybody wants to help

boi-alien
01-24-2003, 10:41 AM
how are you running the program, exactly what are you typing?

M68KACIA
01-24-2003, 11:40 AM
hahahah wait until 413.......then u will realize how easy 233 concept is..

Impreza
01-24-2003, 01:28 PM
well, i just new to java...but i figured it out, just some stupid stuff...
but ya, very frustrating none the less...
I am actually looking for a tutor, as i want to really understand these concepts, anyone here know of someone good?

D'z Nutz
01-25-2003, 12:43 AM
Originally posted by M68KACIA
hahahah wait until 413.......then u will realize how easy 233 concept is..

What are you talking about!? You haven't even taken it! :rofl:

D'z Nutz
01-25-2003, 12:46 AM
Originally posted by Impreza
I am actually looking for a tutor, as i want to really understand these concepts, anyone here know of someone good?

Dunno about tutoring, but there are a lot of programming savy people (myself included) here that I'm sure will help you out if you post any problems.

Impreza
01-25-2003, 01:55 AM
thx!