Exam 9: Arrays
Exam 1: An Introduction to Visual Basic 201544 Questions
Exam 2: Designing Applications60 Questions
Exam 3: Using Variables and Constants60 Questions
Exam 4: The Selection Structure60 Questions
Exam 5: More on the Selection Structure58 Questions
Exam 6: The Repetition Structure60 Questions
Exam 7: Sub and Function Procedures60 Questions
Exam 8: String Manipulation60 Questions
Exam 9: Arrays60 Questions
Exam 10: Structures and Sequential Access Files60 Questions
Exam 11: Classes and Objects60 Questions
Exam 12: Web Applications60 Questions
Exam 13: Working With Access Databases and Linq60 Questions
Exam 14: Access Databases and SQL60 Questions
Select questions type
Assigning initial values to an array is often referred to as ____.
(Multiple Choice)
4.8/5
(21)
Write the statement to declare a procedure-level two-dimensional array named dblRates using the following table of data:
5 5.75 6 6 7 6.25 8 6.5 9 6.75
(Short Answer)
4.8/5
(39)
Based on the statement below,which of the following If clauses determines whether the intSub variable contains a valid subscript for the array? Dim strColors()As String = {"red","green","blue"}
(Multiple Choice)
4.7/5
(37)
When an array is sorted in descending order,the first element in the array contains the smallest value and the last element contains the largest value.
(True/False)
4.8/5
(39)
The statement ____ assigns the string "Paris" to the element located in the first row,second column in the strCities array.
(Multiple Choice)
4.8/5
(35)
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
-Private Sub btnGetHighest_Click(ByVal sender As Object,ByVal e As System.EventArgs)Handles btnGetHighest.Click
' displays the highest prize amount and the
' number of people who won that amount
Dim intPrizes(10)As Integer = {50,25,100,25,100,
25,75,50,40,60}
Dim intHighSub As Integer = intPrizes.GetHighest()
Dim intHighPrize As Integer = intPrizes(0)
Dim intWinners As Integer = 1
For intX As Integer = 1 To intHighSub
If intPrizes(intX)= intHighPrize Then
intWinners *= 1
Else
If intPrizes(intX)< intHighPrize Then
intHighPrize = intPrizes(intX)
intWinners = 1
End If
End If
Next intX
lblHighest.Text = intHighPrize.ToString("C0")
lblWinners.Text = intWinners.ToString
End Sub
(Essay)
4.9/5
(33)
Write the statements to traverse the strCategory array and display each element's value in the lstCategory control.Use a Do...Loop statement.
(Essay)
4.8/5
(35)
How do the elements in parallel one-dimensional arrays relate to each other? Provide an example.
(Essay)
4.8/5
(29)
Case 1 - Tony’s Pizza & Pasta
The restaurant uses an application to update and display menu items and the related price information.
-Which of the following statements declares a class-level one-dimensional array named strToppings that stores the 14 available pizza toppings?
(Multiple Choice)
4.8/5
(30)
If a one-dimensional array contains five elements,its Length property contains the number 5 but its highest subscript is 3.
(True/False)
4.8/5
(27)
The following statement will declare an array.What is the index value for the first element? Dim lakes(5)
(Multiple Choice)
4.8/5
(32)
Write the statement to declare a six-element class-level array named strAnimal,and initialize the array with the following values: dog,cat,mouse,bird,snake,fish.
(Short Answer)
4.8/5
(41)
When a run time error occurs,the computer displays an error message and the application ends abruptly.
(True/False)
4.8/5
(38)
Based on the code below,intScores(3,0)is initialized to ____.
Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
(Multiple Choice)
5.0/5
(37)
Based on the code below,intScores(2,0)is initialized to ____.
Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
(Multiple Choice)
4.9/5
(33)
Write the statement that assigns the string "Treasurer" to the element located in the third row,second column in the strOfficers array.
(Short Answer)
4.8/5
(37)
Based on the code below,intScores(2,1)is initialized to ____.
Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}
(Multiple Choice)
4.9/5
(45)
An advantage of using the For Each…Next statement to process an array is that your code does not need to keep track of the array subscripts or even know the number of array elements.
(True/False)
4.9/5
(43)
A two-dimensional array resembles a table in that the variables (elements)are in rows and columns.
(True/False)
4.8/5
(33)
Case 1 - Tony’s Pizza & Pasta
The restaurant uses an application to update and display menu items and the related price information.
-The intSub variable keeps track of array subscripts and is initialized to 0.The intHighSub variable contains the highest subscript for the strToppings array.Which of the following statements will traverse the strToppings array?
(Multiple Choice)
4.8/5
(38)
Showing 21 - 40 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)