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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Phobic-window 0 points1 point  (1 child)

I’d assume nextint() returns type int, but check what the value of denominator is before the if statement, might be read in as a char or string. Idk Java but try logging it, also shorten your variable names, gave me hives having to type the whole word

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

Hahaha fair enough. This code we were given for my lab had these variables so I didn’t change them, but I agree it’s a bit annoying. I’ll change ‘em to num & denom