In C...
Write a program to simulate a pick-5 lottery game.
Your program must generate and store 5 distinct random numbers between 1 and 9 (inclusive) in an array.
The program prompts the user for:
an integer random seed
five distinct integers between 1 and 9 (which are stored in another array)
The program then compares the two arrays to determine if they are identical.
If the two arrays are identical, then the user wins the game.
otherwise the program outputs the number of matching digits and
their position in the array.
For Example:
Enter an integer random seed: 45 To play the Pick-5 game, enter five integers bewteen 1 and 9 (inclusive): 1 2 3 4 5 You didn't match any numbers! The winning numbers are: 6, 3, 5, 1, 4 Enter an integer random seed: 45 To play the Pick-5 game, enter five integers bewteen 1 and 9 (inclusive): 6 3 1 2 3 You only matched 2 numbers. Your numbers matched the Pick-5 numbers at position(s): 0, 1 The winning numbers are: 6, 3, 5, 1, 4 Enter an integer random seed: 45 To play the Pick-5 game, enter five integers bewteen 1 and 9 (inclusive): 6 3 5 1 4 Congratulations!!! You WIN!!! The winning numbers are: 6, 3, 5, 1, 4
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
In C... Write a program to simulate a pick-5 lottery game. Your program must generate and...
In C program #include<stdio.h> Write a program to simulate a pick-5 lottery game. Your program must generate and store 5 distinct random numbers between 1 and 9 (inclusive) in an array. The program prompts the user for: an integer random seed five distinct integers between 1 and 9 (which are stored in another array) The program then compares the two arrays to determine if they are identical. If the two arrays are identical, then the user wins the game. otherwise...
Write a C++ program that simulates a lottery game. Your program should use functions and arrays. Define two global constants: - ARRAY_SIZE that stores the number of drawn numbers (for example 5) -MAX_RANGE that stores the highest value of the numbers ( for example 9 ) The program will use an array of five integers named lottery, and should generate a random number in the range of 0 through 9 for each element of the array. The user should enter...
Write a C++ program that simulates playing the Powerball game. The program will generate random numbers to simulate the lottery terminal generated numbers for white balls and red Powerball. The user will have the option to self-pick the numbers for the balls or let the computer randomly generate them. Set the Grand Prize to $1,000,000,000.00 in the program. Project Specifications Input for this project: Game mode choice – self pick or auto pick Five numbers between 1 and 69 for...
in a c++ visual studio 2017 ...Write a 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 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 element in the two arrays and keep a count of the digits that match. For...
Using C++ create a lotto program Lottery Design a program that simulates a lottery. Requirements: The program should have an array of 5 integers named lottery and should generate a random number in the range of 1 through 99 for each element of 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...
Hello, I am working on a C++ pick 5 lottery game that gives you the option to play over and over. I have everything working right except that every time the game runs it generates the same winning numbers. I know this is an srand or rand problem, (at least I think it is), but I can't figure out what my mistake is. I've tried moving srand out of the loop, but I'm still getting the same random numbers every...
Need help with assignment This assignment involves simulating a lottery drawing. In this type of lottery game, the player picks a set of numbers. A random drawing of numbers is then made, and the player wins if his/her chosen numbers match the drawn numbers (disregarding the order of the numbers). More specifically, a player picks k distinct numbers between 1 and n (inclusive), as well as one bonus number between 1 and m (inclusive). "Distinct" means that none of the...
PYTHON Write a program for playing a game with the computer. First, generate a random integer in the range of 6 through 9. This will be the computer’s pick. Then generate three random integers for the human player. These random integers are in the range of 1 through 10. If any of these three random integers is greater than the computer’s pick, the human player wins the game. Otherwise, the human player loses. You must use a for loop to...
Write a C program to simulate an online lottery game. Assume that the winning numbers are 10 and their values are within [0, 100]. Write a C program in a way to control the winning numbers. In particular, the "cheat" is that 3 of the winning numbers in each lottery should have also been drawn in the previous one. The C program asks the user to play, and if the answer is no, the program terminates.
Write a C program with a filename netID_intarray.c that has 2 arrays. One is a two-dimensional array of strings which contains 5 words, each word can be a max of 20 characters long. The list of strings should be static in your code. The second integer array is populated by prompting the user for 10 integers to be stored in the array. Here is the simple output: $ ./run Number Work Enter integer 1 for the array: 45 Enter integer...