The task states:
"You must create a program in Scratch where the sprite you choose asks you to enter a number. Once this number is entered you must allow the user to enter a second number.
You must then apply an algorithm that will let the user know if the smaller number is a factor of the bigger number or not."
We were given the hint that "mod" is required. This was our first lesson with Scratch so I'm pretty much clueless. Help, please? I just need help with the algorithm.
Offline
when gf clicked ask [First number?] and wait set [answer 1 v] to (answer) ask [Second number?] and wait set [answer 2 v] to (answer) set [number v] to <(answer 2) mod (answer 1)> if <(number) = (0)> say [The first number is a factor of the second number] else say [The first number is not a factor of the second number]Tried and tested.
Offline
Thank You Very, Very Much!
Offline