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

  Why normalizing a sound take longer than raising amplitude

Compare the individual programs. Does normalizing a sound take longer than raising (or lowering) the amplitude a constant amount? How much longer?

  Advantages of technologies

List some of the advantages of some of current technologies explained in our reading this week involving VoIP, Virtual Private Networks, Unified Communications, Wi-Fi and wireless technologies such as RFID.

  Designing a network architecture

Describe how the overall network architecture addresses the security threats and vulnerabilities

  What methods should each class have

What methods should each class have? How and where would you keep track of things like orbital parameters?

  Define all the properties of decoder

Modify the 3-to-8 decoder circuit in Figure so that all the eight outputs are active-low and add an active-high ENABLE input. When the ENABLE input is high.

  Critical forensics analysis of iphone

This is a research and development project on a topic related to digital investigation and forensic computer. Critical Forensics Analysis of Iphone

  Facilitate requirement elicitation, specification

What process or tools are you familiar with that facilitate requirements elicitation, specification and decomposition?

  Create a gui pad that has numbers and letters

Create a GUI pad that has numbers and letters(That can be capitalized), and a text area to display One button that clears the text.

  Describe the steps necessary to configuring validation

Describe the steps necessary to configuring validation and revocation so that the validation requests are handled efficiently.

  Identify and analyze what you believe to be the most

write a four to five 4-5 page paper in which youidentify and analyze what you believe to be the most significant new

  For the arithmetic expressions below draw a binary tree

question for the arithmetic expressions below draw a binary tree that represents the expression and then use tree

  Define the highest and lowest integer that can represented

Define the highest and lowest integer that can be represented in this 7-bit two's complement representation.

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