a function that returns a random number that is a multiple of 3 between 0 and the function's non-negative integer parameter n
- by martin
I need to write a function called multipleOf3 that returns a random number that
is a multiple of 3 between 0 and the function's non-negative integer
parameter n
and here is the result i want [Note: No number returned can be greater than the value of the
parameter n]
Examples:
multipleOf3(0) -- 0
multipleOf3(1) -- 0
multipleOf3(2) -- 0
multipleOf3(3) -- 0 or 3
multipleOf3(20) -- 0 or 3 or 6 or 9 or 12 or 15 or 18