Write a program that simulates a lottery. The program shouldhave an array of fiv
ID: 3615355 • Letter: W
Question
Write a program that simulates a lottery. The program shouldhave an array of five integers named lotery , and should generate a random number in the range of 0through 9 for each element in the array. The user should enter five digits which should be stored in aninteger array named user . The program is to compare the corresponding elements in the two arrays andkeep a count of the digits that match. The program should display the random numbers stored in the lotery array and the number of matching digits. If all of them match, display a message proclaimingthe user as a grand prize winner. The program should repeat the lottery simulation until the user wants tostop. Write a program that simulates a lottery. The program shouldhave an array of five integers named lotery , and should generate a random number in the range of 0through 9 for each element in the array. The user should enter five digits which should be stored in aninteger array named user . The program is to compare the corresponding elements in the two arrays andkeep a count of the digits that match. The program should display the random numbers stored in the lotery array and the number of matching digits. If all of them match, display a message proclaimingthe user as a grand prize winner. The program should repeat the lottery simulation until the user wants tostop.Explanation / Answer
please rate - thanks check the post--Gaddis arrays aren't until chapter 7 #include #include //#include using namespace std; string random(int,int); int main() {int lotery[5],match,named[5]; int i,play; srand(time(0)); do { for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.