- Create a button and Click event handler namedbtnCountingNumbers.Write the statements to declare a one-dimensional array namedCountingNumbers,having a data type ofIntegerand 10 elements. Declare this variable in the event handler as a local variable. Initialize the value of each element so that its value is the same as the element’s index value. That is, the first array element should have a value of 0, the second array element should have a value of 1, and so on. To get full credit, you must use aForloop to initialize the array.
- Create a button andClickevent handler namedbtnRandomList.Write the statements to declare a one-dimensional array namedRandomList,having a data type ofDoubleand 500 elements. Write the statements to initialize the array to random double precision values. To do this, create an instance of theRandomclass namedRandCurrentusing a random seed value.
- Create a button andClickevent handler namedbtnCopyList.Declare two one-dimensional arrays exist namedInputListandOutputList,having the samesize and data types ofDouble. Initialize the array named InputList with 5 values. Write the statements to copy the data from the array named InputList to the array named OutputList. Use theGetUpperBound()method to determine the size of the input array. Do not use theCopymethod of theArrayclass to copy the data. Then write the statements to increase the values of the elements in the array named OutputList by 10 percent. Declare any local variables, as necessary.
- Create a button andClickevent handler namedbtnSumArray.Declarea two-dimensional array exists named Grid and initialize the values as shown in the following table: Write the statements to total the values for all of the array elements. Use the GetUpperBound() method to get the number of elements in each array dimension. Store the total value of all array elements in the variable Total. Declare any local variables, as necessary. Display the result as you see fit.
12.1 / 13.2 / 14.3 / 15.4 / 16.5
21.1 / 22.2 / 23.3 / 24.4 / 25.5
31.1 / 32.2 / 33.3 / 34.4 / 35.5
- Declarea scalar variable namedWordshaving a data type ofString.Initialize the variable so that it contains a sentence or two. Declarea one-dimensional array named LetterCount, having a data type of Integer and 26 elements (one element for each letter of the alphabet). Write the statements to count the number of instances of each letter of the alphabet by examining each character in the string. If the character is the letter “a”, increment the value of the first element in the second array; if the character is the letter “b”, increment the value of the second element in the second array; and so on. Perform the count in a case-insensitive way. Assume that the string contains only letters. In a control of your choosing, write the statements to display each letter and the count of the letter.
- Assume that a form has some number of TextBox control instances. Write the statements to declare an array named TextBoxList having a data type of TextBox. Write the statements to enumerate the Controls collection of the form. If the current control instance has a data type of TextBox, add a reference to the control instance to the array. Redimension the array, as necessary, and preserve its contents.
- For this question, use the following class:
- Public Class Customer
- Public AccountNumber As Integer
- Public FirstName As String
- Public LastName As String
- Public BalanceDue As Double
- End Class
Create aList(Of Customer). Now create 250 sample customers as follows:
- Sequentially number the customers starting with account number 100000
- Create random first names and last names as shown in the lab. Use at least 10 first names and last names in the string arrays.
- The Balance Due should be a random value between 100.00 and 9999.99.
- The Active flag should be set randomly to true or false.