[cs13001] check() function use in Lab6_Lottery

Dianne Foreback dforebac at kent.edu
Sat Jul 4 08:53:30 EDT 2015


 Dear Summer 2015 CSI Class:

In reply to a question about the check() function.

The check() function is invoked in both the draw() and main() functions.
In the draw() function, if check() returns false, then the randomly
generated number does not exist in the wins[] array already, so it can be
added to the array.  In the main() function, if check() returns true, then
the user won the lottery game.

Notice, functions may be invoked in multiple places making the function
code reusable.

Best Regards,
Dianne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://listmail.cs.kent.edu/pipermail/cs13001/attachments/20150704/d8ca718e/attachment.html 


More information about the cs13001 mailing list