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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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