> I'm building a maths program for year 6 children.
Problem with division - I generate a random number between say 1 and
1000. I want to generate another random number which when divided by the first
number gives a whole number answer. Any Idea how I could do this?
Obviously generating prime numbers is a bit of a problem as well!
Instead of generating a number and trying to find whole number divisors,
what about generating two numbers whose product is 1000 or less and then
presenting that product and one of the numbers you used in the
multiplication to the child... the other number is the answer. Something
like this should work...
FirstNumber = 1 + Int(50 * Rnd)
MaxForSecondNumber = Int(1000 / FirstNumber)
SecondNumber = 1 + Int(MaxForSecondNumber * Rnd)
Product = FirstNumber * SecondNumber
Of course, this doesn't address the "hardness" value of the division.
Rick - MVP