Question: I need help writing this program in C++ code. Write a program that simulates a lottery. The program should have an array of 6 integers
I need help writing this program in C++ code.
Write a program that simulates a lottery. The program should have an array of 6 integers named lottery and should give a random number in the range 0 through 9 for each element in the array. The user should enter 6 digits which should be stored in a separate integer array named user. The program should compare the corresponding elements in the two arrays and keep a count of how many digits match. For example the following shows the lotter array and the user array with sample numbers stored in each. There are two matching digits (the third and fifth). lottery array: 7 4 9 1 3 3 user array: 4 2 9 7 3 5 The program should display the random numbers stored in the lottery array and the number of matching digits. If all of the digits match, dispaly a messge proclaiming the user as a winner. Make sure to break you program into several functions that each receive parameters and return a value to their calling functions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
