Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

programming practice help begginner C# programming help 2. Declare 2 class level integer arrays to hold the random numbers There are 7 whole numbers chosen

programming practice help
image text in transcribed
image text in transcribed
begginner C# programming help
2. Declare 2 class level integer arrays to hold the random numbers There are 7 whole numbers chosen for the player There are 6 whole numbers chosen as the winning numbers 3. Add the following user defined methods to your code: a) private void Generate Random Numbers (intl numberArray) This method accepts one integer array as a parameter - arrays are passed by reference, hence there is no need to pass back the array to the calling method This method will loop through the array generating random numbers between 1 and 49. To make sure that the same number is not used twice, we will require a second loop inside the first loop) that checks that the number has not been used before b) private string BuildDisplayString (int[] numberArray) Inside this method, loop through the array that is passed in and add cach element to a string variable. Return this string to the calling method - where it will display it to the appropriate label. c) private int CompareTWoArrays (intll array, int[] array2) This method will loop through one of the arrays. Each element of this array will checked against all clements of the second array-using either another loop or possibly an Array method -checking for a match If a match is found, increment a variable holding the number of matching values - when done, this value is passed back to the calling method. 4. Code the btnPlayer_Click() event handler method: This event will require you to generate random numbers for the player and display these numbers to the appropriate label Use the appropriate methods you defined above. 5. Code the btnComputer Click() event handler method: This event will require you to generate random numbers for the computer-the winning numbers - and display them to the appropriate label The event will also determine the number of matching numbers between the winning numbers and the player's numbers. Display this value to the appropriate label Use the appropriate methods you defined above. 6. Other requirement: Comments at the very least, your name) Variable names that follow naming conventions Proper code spacing (tabbing) No un-coded event handlers (delete them) Lotto Number Picker Your Numbers 02 17 23 27 36 38 42 Generate Winning Numbers 04 16 17 27 28 46 Let's Play Matching Numbers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions