Filters
Question type

Study Flashcards

Write the statement to declare a procedure-level two-dimensional array named dblRates using the following table of data: 55.756676.2586.596.75\begin{array} { | l | l | } \hline 5 & 5.75 \\\hline 6 & 6 \\\hline 7 & 6.25 \\\hline 8 & 6.5 \\\hline 9 & 6.75 \\\hline\end{array}

Correct Answer

verifed

verified

Dim dblRates(,)As Do...

View Answer

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?


A) Do While intSub >= intHighSub
B) For intHighSub As Integer = 0 To intSub
C) Do While intSub <= intHighSub
D) For intSub As Integer = 1 To intHighSub

E) B) and D)
F) None of the above

Correct Answer

verifed

verified

Based on the code below,intScores(2,0) is initialized to ____. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}


A) 25
B) 23
C) 56
D) 75

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

Write the statements to traverse the strCategory array and display each element's value in the lstCategory control.Use a Do...Loop statement.

Correct Answer

verifed

verified

Dim intHighestSub As Integer =...

View Answer

The following statement will declare an array.What is the index value for the first element? Dim lakes(5)


A) 0
B) 1
C) 4
D) 5

E) None of the above
F) All of the above

Correct Answer

verifed

verified

Write the statement that assigns the string "Treasurer" to the element located in the third row,second column in the strOfficers array.

Correct Answer

verifed

verified

strOfficer...

View Answer

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.

A) True
B) False

Correct Answer

verifed

verified

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"}


A) If intSub > 0 AndAlso intSub < 2 Then
B) If intSub >= 0 AndAlso intSub =< 2 Then
C) If intSub > 0 AndAlso intSub < 3 Then
D) If intSub >= 0 AndAlso intSub =< 3 Then

E) A) and C)
F) C) and D)

Correct Answer

verifed

verified

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.

A) True
B) False

Correct Answer

verifed

verified

Assigning initial values to an array is often referred to as ____.


A) sorting the array
B) populating the array
C) assigning the array
D) declaring the array

E) B) and C)
F) C) and D)

Correct Answer

verifed

verified

How do the elements in parallel one-dimensional arrays relate to each other? Provide an example.

Correct Answer

verifed

verified

A parallel one-dimensional array involve...

View Answer

If a one-dimensional array contains five elements,its Length property contains the number 5 but its highest subscript is 3.

A) True
B) False

Correct Answer

verifed

verified

Based on the code below,intScores(3,0) is initialized to ____. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}


A) 6
B) 12
C) 23
D) 56

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

Based on the code below,intScores(2,1) is initialized to ____. Dim intScores(,) As Integer = {{75, 90}, {9, 25}, {23, 56}, {6, 12}}


A) 25
B) 23
C) 56
D) 75

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

When a run time error occurs,the computer displays an error message and the application ends abruptly.

A) True
B) False

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Private Sub btnGetHighest_Click(ByVal se...

View Answer

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?


A) Dim strToppings(13) As String
B) Private strToppings(13) As String
C) Dim strToppings(14) As String
D) Private strToppings(14) As String

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

A two-dimensional array resembles a table in that the variables (elements)are in rows and columns.

A) True
B) False

Correct Answer

verifed

verified

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.

Correct Answer

verifed

verified

Private strAnimal()A...

View Answer

The statement ____ assigns the string "Paris" to the element located in the first row,second column in the strCities array.


A) strCities(1, 1) = {Paris}
B) strCities(0, 1) = "Paris"
C) strCities(0, 0) = (Paris)
D) strCities(1, 0) = "Paris"

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Showing 21 - 40 of 60

Related Exams

Show Answer