Create a project titled Lab6_Lottery. Declare an
array wins of 10 integer elements. Define a
function draw that takes array wins as a
parameter and fills it with 10 integers whose values are from 0 to
99. Note that the numbers should not repeat this time.
Define a function entry that asks the user to enter a single number from 0 to 99. This function should take the user entry as a call-by-reference parameter. Define a function check that takes the number input and array wins as parameters and returns the index of the array element that matches the input number or -1 if none of the elements do.
Create another function printOut that prints the selected numbers, user input, and whether the user won the lottery. The general outline of your function main() should be as follows:
main(){ // array and other variable declarations draw(...) entry(...) check(...) printOut(...) }
Note: A program that processes each element of the array separately (i.e. accesses all 10 elements of the array for assignment or comparison outside a loop) is inefficient and will result in a poor grade.
Make sure your programs adhere to proper programming style. Submit your projects to the subversion repository. Do not forget to verify your submission on the web.