Write a program that simulates a lotto

Assignment Help Computer Engineering
Reference no: EM132077788

You need help with this program. It needs to be in the C++ language and format - something I'm not familiar with. Also, it would be a great help if you could take a picture/snapshot of the program and upload it. Thanks!

The picture might not be clear so here's the text version of the instructions:

Write a program that simulates a Lotto 6/49. The program should have an array of six integers named lottoNumbers, and should generate a unique random number in the range of 1 through 49 for each element in the array.

The program should also have an integer variable named bonus to store the bonus number (again, the bonus number is a unique random number in the range of 1 through 49).

The user should enter the six unique numbers (1 through 49) which should be stored in an integer array named userNumbers. The program is to compare the numbers in the two arrays as well as the bonus number and display the number of matches to the screen as follows:

If the user numbers matches all six random numbers, the program must display the number of matching numbers and a message proclaiming the user as a grand prize winner.

Else, the program must display the number of matching numbers and the bonus number to the screen.

In addition, your program should use a while or do...while statement to check whether the user would like to quit or continue checking more lotto numbers.

Your program must implement and use the following functions (NOTE: IF YOU FAILED TO IMPLEMENT AND USE ANY OF THESE FUNCTIONS OR FAILED TO FOLLOW THE FOLLOWING INSTRUCTION WILL RESULT IN A SUBSTANTIAL DEDUCTION OF YOUR GRADE):

1. void generateLottoNumbers(int lottoNumbers[],int ARRAYSIZE, int &bonus) This function must generate six UNIQUE random numbers in the range of 1 through 49 for each element in the array and a bonus number in the range of 1 through 49 that is different from any of the six numbers in the array.

2. void getUserNumbers(int userNumbers[],int ARRAYSIZE) This function must prompt the user to enter six numbers in the range of 1 through 49 and store then in the array, userNumbers. NOTE: this function must verify the range and the uniqueness of each number before storing them to the array.

3. void printArray(int numbers[],int ARRAYSIZE) This function prints the content of the array, numbers to the screen (separated by a space).

4. int countMatch(int lottoNumbers[],int userNumbers[],int ARRAYSIZE) This function returns the number of matches between the lottoNumbers and userNumbers.

5. bool matchBonus(int userNumbers[],int ARRAYSIZE, int bonus) This function returns true if one of the numbers in the userNumbers array matches the bonus number and false otherwise.

6. bool isWinner(int lottoNumbers[],int userNumbers[],int ARRAYSIZE) This function returns true if all userNumbers match the lottoNumbers and false otherwise. NOTE: you must call the countMatch function to determine the number of matches between userNumbers and lottoNumbers.

Reference no: EM132077788

Questions Cloud

Calculate the wall area of each room : Create Customer - allow user input of all items in requirement 7 above. Input must allow measurements in feet up to 1 decimal place i.e. Length = 6.5.
Compute the expressions that follow in double precision : Compute the expressions that follow in double precision arithmetic for x = 10-1,...,10-14. Display results to all digits (in MATLAB use format long).
Growing at the moment when each side measures 5 inches : If the area of a square is increasing by 10 square inches per minute, how quickly is the length of each side growing at the moment when each side measures 5 inc
Make the sort methods return an integer with this count : For each algorithm, count the number of times it loops (you can make the sort methods return an integer with this count).
Write a program that simulates a lotto : Write a program that simulates a Lotto 6/49. The program should have an array of six integers named lottoNumbers.
Find all of the different stores that are in the central : How would i find all of the different stores that are in the 'central' district?.
Prepare a job claim statement : ACC703 Accounting Information - King’s Own Institute - You may contact the employer and get the position description to contain a more in depth description
Define and test these two python functions : Define and test these two Python functions. You must use recursion to define them: you are not allowed to use loops or local variables.
Make an interface that allows the user to search for an item : Make an interface that allows the user to search for an item with a nice background photo.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Define relationships between users and permissions

Assume a system with N job positions. For job position i, the number of individual users in that position is Ui and the number of permissions.

  Design a message display application

Design a message display application. Allow users to enter their name and favorite saying in a single method that gets invoked two times.

  Discuss the issue of securing backups

Discuss the issue of securing backups. There have been several incidents lately in which backup media containing personal customer information were lost.

  Perform a valuable function as a system

With both full and partial adding systems we combine logic gates to perform a valuable function as a system.

  What value of m will the network that optimizes bic score

At what value of M will the network that optimizes the BIC score be the same as the network that optimizes the likelihood score?

  How are you going to connect the two computers

How are you going to connect the two computers? List as many possible solutions as you can, with the advantages and disadvantages of each.

  Program calculates and displays the mortgage payment amount

make a procedural C++ program that calculates and displays the mortgage payment amount that will display mortgage amount, the term of the mortgage, and the interest rate of the mortgage.

  Develop a detailed implementation plan

In this final week, you have one more major task. Develop a detailed project plan for all of the final implementation, acceptance confirmation.

  Develop logic for a program that accepts number of passenger

Develop the logic for a program that accepts the number of passengers and zones crossed as input. The output is the ticket charge.

  Questiontwo stacks of positive integers are required both

questiontwo stacks of positive integers are required both containing integers with values less than or equal to 1000.

  Convert a unix shell script into a perl script

Convert a UNIX shell script (User Maintenance) into a Perl script. This Perl script must perform the following tasks: Generate a menu to ask the system administrator for the task that he or she would like to see performed.

  Design an application that instantiates an object

Design an application that instantiates an object of each type and demonstrates all the methods.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd