Question: PROGRAM NEEDS TO BE WRITTEN IN C++ Jumping in the Mega Millions fever, your lab is to write a program that simulates the Mega Millions

PROGRAM NEEDS TO BE WRITTEN IN C++

Jumping in the Mega Millions fever, your lab is to write a program that simulates the Mega Millions lottery draw. Your program must have an array of five integers named winningNumbers, with a randomly generated number in the range of 0 through 9 for each element in the array. Your program should ask the user to enter five numbers and should store them in a second integer array named player. The program must compare the corresponding elements in the two arrays and count how many numbers match. For example, the following shows the winningNumbers array and the Player array with sample numbers stored in each. There are two matching elements, elements 2 and 4.

winningNumbers 7 4 9 1 3
Player 4 2 9 7 3

Once the user has entered a set of numbers, the program should display the winning numbers and the players numbers and tell how many numbers matched.

Here is an example of the possible output from your code:

/* SAMPLE RESULTS RUN 1

Submit the five numbers of your lottery number, separated by blanks: 9 3 4 4 1

Winning number: 30766 Your number : 93441

You have 0 matching digit(s).

SAMPLE RESULTS RUN 2

Enter the five numbers of your lottery number, separated by blanks: 5 5 4 1 7

Winning number: 46419 Your number : 55417

You have 2 matching numbers. */

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!