Sam Lewis wrote:I am not sure how to start to get the 10 fractions ramdoly they can be between 1-100000 but cannot equal 1,
Can we see this code? Please post.Sam Lewis wrote:...He has given us a code for the fraction class.,
Sam Lewis wrote:... get the 10 fractions ramdoly they can be between 1-100000 but cannot equal 1,
Sam Lewis wrote:if they dont simplify then it skips thems.
Carey Brown wrote:
Sam Lewis wrote:... get the 10 fractions ramdoly they can be between 1-100000 but cannot equal 1,
In other words, 2-100000 (inclusive). So, how would you use Random#nextInt(N) to return that range?
Better but not correct. This range is 0-99999 (inclusive).
There are three kinds of actuaries: those who can count, and those who can't.
You mean the fraction must be less than 1, probably. As Piet says, you will have problems:-Sam Lewis wrote:. . . it has to be less then 0
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|