NumberAnalysis
Write a program that simulates a lottery.
The program shall have an array of five integers named lottery and should generate a random number in the range of 0 through 9 for each element in the array.
The user shall enter five digits, which are stored in an integer array named user.
The program is to compare the corresponding elements in the two arrays and keep a count of the digits that match.
For example, the following shows the lottery array and the user array with sample numbers stored in each. There are two matching digits (elements 2 and 4).
lottery array:
7 4 9 1 3
user array:
4 2 9 7 3
The program shall display the random numbers stored in the lottery array and the number of matching digits. If all of the digits match, display a message proclaiming the user as a grand prize winner.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.