Lottery Simulator

I have to make a program that simulates a lottery. The program should have an array of 5 digits named winningdigits, a randomly generated number in the range of 0 through 9 for each element in the array. The program should ask the user to enter 5 digits and should store them in a second integer array named player. The program must compare corresponding elements in two arrrays and count how many digits match.

This is an example: There are two matching digits, elements 2 and 4.
winningDigits: 7, 4, 9, 1, 3
player: 4, 2, 9, 7, 3
Print out the matches and how much money the user made.
Money made = Match(es) X 100
Example:
2 Matches = $200

So far I have this, I'm not sure how to make them match. Do I do the same type of thing for player like I did for winningDigits? I'm not really sure what to do after this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
using namespace std;


int main()
{
    int winningDigits[5];
    int Matches;
    int i; 
    int a[10];

    for (int i = 0; i<5; i++)
        winningDigits[i] = rand() % 10;

    cout << a[10] << endl; 

    Money made = Matches  X 100


    system("pause");
    return 0;
}
Topic archived. No new replies allowed.