I need help with the following group of questions, this is part of a set: Book:
ID: 3772549 • Letter: I
Question
I need help with the following group of questions, this is part of a set:
Book: Microsoft Visual Basic 2012 (8th Edition)
Chapter 8 Knowledge Check.
1. Using implicit sizing, assign the integers 6,9,18, 26 and 17 to an array named intLuckyWinners.
2. Write a statement that assigns the length of an array named strAddressBook to a variable named intAddressCount.
3. What is the upper-bound index of an array whose size isd 75?
4. Write a line of code that initializes an array named intEvenNumbers with the first five even numbers, starting with 2.
5. Answer the following questions about the following initiazlied array:
Dim strCityNames (6) as String
A. Assign Detroit to te first array location. What is the index number?
B. Assign Miami to the fourth location in the array. WHat would the assingment statement look like?
C. What value does strCityNames.Length have?
D. How many cities can this array hold?
E. What would happen if you assigned strCityNames(7)="Houston"
Explanation / Answer
1)
Dim intLotteryWinner() As Integer = { 4, 18, 31,26,17 }
2)
int intAddressCount = strAddressBook.length;
3)
The Upper Bound of an array means the top most index of the array (very last item available) So Array(75) would have a UBound of say 74 and an LBound of 0
4)
Dim intEvenNumbers(5) as Integer={2,4,6,8,10}