Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Intro c++ practice help using List collection as opposed to arrays. 1. Use the Visual Studio Development Environment to create a user interface 2. Set

Intro c++ practice help using List collection as opposed to arrays.
image text in transcribed
image text in transcribed
image text in transcribed
1. Use the Visual Studio Development Environment to create a user interface 2. Set properties to customize components 3. Register events and write code using the code editor 4. Set and retrieve component properties in code. 5. Use variables and collections to store program data. 6. Use control structures to control program flow. 7. Modularize code with user defined methods 8. Use online help and other sources of information to help solve problems. Preamble: You will rewrite the program from lab 5 - The Lotto Number Generator - that uses List arrays. collections instead of Instructions Requirements: 1. Download the Lab 5 starting files that are posted in Blackboard or use your finished solution from lab 5. 2. Declare 2 class level integer Lists 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 Randon Numbers List int berList) . This method accepts one integer Liso as a parameter - Lisos are passed by reference, hence there is no need to pass back the List to the calling method. This method will loop through the Listo generating random numbers between 1 and 49 Add code that checks that the number has not been used before. b) private string BuildDisplayString List int number List) Inside this method, loop through the List that is passed in and add each 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 (Listint> listi, List int> list2) . This method will loop through one of the Lists Each dement of this List will checked against all elements of the second Listo checking for a match If a match is found, incrementa 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 ben Computer 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) 1 Use the Visual Studio Development Environment to create a user interface 2. Set properties to customize components 3. Register events and write code using the code editor 4. Set and retrieve component properties in code Use variables and collections to store program data 6. Use control structures to control program flow 7. Modulare code with user defined methods. & Use online help and other sources of information to help solve problems Preatle) You will rewrite the program from lab 5 - The Lotto Number Generator - that uses Liso collections instead of Instructions Requirements: 1 2 3. Download the Lab starting files that we posted in Blackboard-or use your finished solution from labs. Declare 2 class levelinger Lido to hold the random numbers There are whole numbers chosen for the player . There are 6 whole numbers chosen as the winning numbers Add the following user defined methods to your code a) private void GenerateRandom Numbers List int numberlist) This method accepts one integer Listas a parameter s are passed by reference, hence there is no need to pass back the Listo to the calling method This method will loop through the Liso generating random numbers between 1 and 49 Add code that checks that the number has not been used before. b) private string BuildDisplayString List int number List) Inside this method, loop through the Liso that is passed in and add each element to a string variable . Return this string to the calling method - where it will display it to the appropriate label c) private int Compare twoArrays (Listint listi. Listint> list2) . This method will loop through one of the Listos. Each element of this List will checked against all elements of the second Listo checking for a match If a match is found, incrementa variable holding the number of matching values - when done, this value is passed back to the calling method Code the ben Player 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 Code the benComputer 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 mmbers between the winning numbers and the player's numbers. Display this value to the appropriate label Use the appropriate methods you defined above Other requirement Comments at the very least, your name) Variable names that follow aming Conventions 4 5. 6 Proper code spacing (tabbing) Now-coded event handlers (delete them) Instructions/Requirements: 1. Download the Lab 5 starting files that are posted in Blackboard-or use your finished solution from lab 5. 2. Declare 2 class level integer Lists 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 GenerateRandomNumbers (List numberList) Inside this method, loop through the List that is passed in and add each element to a string variable. . Return this string to the calling method - where it will display it to the appropriate label. c) private int Compare TwoArrays (List listi, List list2) . This method will loop through one of the Listos. Each element of this List will checked against all elements of the second Listo checking for a match. If a match is found, incrementa 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) 1. Use the Visual Studio Development Environment to create a user interface 2. Set properties to customize components 3. Register events and write code using the code editor 4. Set and retrieve component properties in code. 5. Use variables and collections to store program data. 6. Use control structures to control program flow. 7. Modularize code with user defined methods 8. Use online help and other sources of information to help solve problems. Preamble: You will rewrite the program from lab 5 - The Lotto Number Generator - that uses List arrays. collections instead of Instructions Requirements: 1. Download the Lab 5 starting files that are posted in Blackboard or use your finished solution from lab 5. 2. Declare 2 class level integer Lists 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 Randon Numbers List int berList) . This method accepts one integer Liso as a parameter - Lisos are passed by reference, hence there is no need to pass back the List to the calling method. This method will loop through the Listo generating random numbers between 1 and 49 Add code that checks that the number has not been used before. b) private string BuildDisplayString List int number List) Inside this method, loop through the List that is passed in and add each 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 (Listint> listi, List int> list2) . This method will loop through one of the Lists Each dement of this List will checked against all elements of the second Listo checking for a match If a match is found, incrementa 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 ben Computer 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) 1 Use the Visual Studio Development Environment to create a user interface 2. Set properties to customize components 3. Register events and write code using the code editor 4. Set and retrieve component properties in code Use variables and collections to store program data 6. Use control structures to control program flow 7. Modulare code with user defined methods. & Use online help and other sources of information to help solve problems Preatle) You will rewrite the program from lab 5 - The Lotto Number Generator - that uses Liso collections instead of Instructions Requirements: 1 2 3. Download the Lab starting files that we posted in Blackboard-or use your finished solution from labs. Declare 2 class levelinger Lido to hold the random numbers There are whole numbers chosen for the player . There are 6 whole numbers chosen as the winning numbers Add the following user defined methods to your code a) private void GenerateRandom Numbers List int numberlist) This method accepts one integer Listas a parameter s are passed by reference, hence there is no need to pass back the Listo to the calling method This method will loop through the Liso generating random numbers between 1 and 49 Add code that checks that the number has not been used before. b) private string BuildDisplayString List int number List) Inside this method, loop through the Liso that is passed in and add each element to a string variable . Return this string to the calling method - where it will display it to the appropriate label c) private int Compare twoArrays (Listint listi. Listint> list2) . This method will loop through one of the Listos. Each element of this List will checked against all elements of the second Listo checking for a match If a match is found, incrementa variable holding the number of matching values - when done, this value is passed back to the calling method Code the ben Player 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 Code the benComputer 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 mmbers between the winning numbers and the player's numbers. Display this value to the appropriate label Use the appropriate methods you defined above Other requirement Comments at the very least, your name) Variable names that follow aming Conventions 4 5. 6 Proper code spacing (tabbing) Now-coded event handlers (delete them) Instructions/Requirements: 1. Download the Lab 5 starting files that are posted in Blackboard-or use your finished solution from lab 5. 2. Declare 2 class level integer Lists 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 GenerateRandomNumbers (List numberList) Inside this method, loop through the List that is passed in and add each element to a string variable. . Return this string to the calling method - where it will display it to the appropriate label. c) private int Compare TwoArrays (List listi, List list2) . This method will loop through one of the Listos. Each element of this List will checked against all elements of the second Listo checking for a match. If a match is found, incrementa 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)

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

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago