Generate a random integer within a given range AND is even ONLY
I am having trouble generating this code which I'm sure I'm just in a
coder's block or something because it seems as though it should be easy
but can't get it for the life of me.
I have a program which needs random numbers generated within a certain
range which is to represent money. The stipulation is that the money need
be in between 2 and 200 and represent only even dollars only so $2, $4,
$6...so on. I have done extensive searching online which yield a bounty of
code to represent random numbers in a range in java but not the part about
being only even.
Any ideas?
No comments:
Post a Comment