Question
Sequence Check In Visual Basic Design a Form that has a multi-column Listbox and a Button to start the execution. Name the button and double
Sequence Check
In Visual Basic
Design a Form that has a multi-column Listbox and a Button to start the execution. Name the button and double click the it to create the Event Handler. Save and open the file below. Copy and paste the array definition in it to the Event Handler. This is an one dimensional array with a bunch of numbers. There are 100 elements in the array.
Dim intSeq() as Integer = { 1, 2, 3, 4, 5, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 30, 32, 33, 35, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 52, 54, 55, 56, 58, 57, 59, 60, 61, 62, 63, 65, 64, 66, 67, 68, 69, 70, 71, 72, 74, 73, 76, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 88, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 }
You may need to line up the array better in the code than it is when you copy/paste.
1. Use a For loop display the array in the Listbox. There should be 4 columns of numbers with 25 numbers per column. Also, sum all the numbers in the array. Create a Label in the Form to display this sum.
2. Use another new For loop to perform a Sequence Check of the numbers in the array. A number is Out of Sequence if the current number is greater than the next number. Here is an example of a simpler array:
1 2 4 3 5 7 8 9 11 10 12 13
The program would display in the Listbox:
Out of Sequence 4 11
Because the 4 is greater than the next number 3, and 11 is greater than the next number 10.
Submit the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started