Write a program that imitates a lottery the program will


Write a program that imitates a lottery. The program will use two one-dimensional arrays to store the winning numbers and the user's choices. A function will be use to decide whether the user has won or not.

The program should:

  1. Declare two arrays that hold 5 ints
  2. One of the arrays, named winningDigits[],
    • should have elements that are randomly generated integers between the values 1 and 20.
    • The assigning of the elements of the array winningDigits[] should be done in a function void pickwinning(int [], int).
  3. The program should ask the user to enter 5 integers between 1 and 20.
    • Values less than 1 or greater than 20 should not be accepted.
    • The valid input values should be stored in the second int array of 5 elements, pickfive[].
  4. In a function, int compareValue(const int [], const int [], int),
    • the two arrays should be compared element by element.
    • The function counts the number of identical elements and returns this value.
  5. The program should then print out the winning digits, the user's digits and how many elements were a match.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that imitates a lottery the program will
Reference No:- TGS0662091

Expected delivery within 24 Hours