The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 408 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write a C++ program that simulates a lottery. The program should 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 should enter five digits which should be 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 should 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.
Programming
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------