Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Programming with Microsoft Visual Basic
Quiz 9: Arrays
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 41
Short Answer
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
\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}
5
6
7
8
9
5.75
6
6.25
6.5
6.75
Question 42
Multiple Choice
Case 1 - Tony’s Pizza & Pasta The restaurant uses an application to update and display menu items and the related price information. -You have decided the Daily "Chef's Specials" need to be stored in a two-dimensional array rather than two parallel one-dimensional arrays.Which of the following statements will declare the array as a procedure-level array named strDailySpecial? The number of rows is based on the number of days in the week,and Sunday remains the first element for the days of the week.
Question 43
Essay
Write the statements to traverse the strCategory array and display each element's value in the lstCategory control.Use a For Each...Next statement.
Question 44
Essay
How do the elements in parallel one-dimensional arrays relate to each other? Provide an example.
Question 45
Essay
Explain the difference between a simple variable and an array.
Question 46
Essay
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
Question 47
Essay
The following array is declared and initialized: Dim dblMilesPerTrip()As Double = {542,28,79.5,322.6,114} Write the statements to total the values in the array.
Question 48
Short Answer
Write the statement to declare a twelve-row,two-column procedure-level array named strLocations,initializing each element to the keyword Nothing.
Question 49
Short Answer
Write the statement to declare a seven-element procedure-level array named strItemCode with each element initialized to the keyword Nothing.
Question 50
Multiple Choice
Case 1 - Tony’s Pizza & Pasta The restaurant uses an application to update and display menu items and the related price information. -Daily "Chef's Specials" are stored using two one-dimensional parallel arrays.The days of the week are stored in the strDays array,with Sunday as the first element.The daily special for each day is stored in a parallel array named strSpecial.Which of the following statements assigns Friday's special,which is rigatoni,to the appropriate element?
Question 51
Short Answer
Write the statement to declare a five-element procedure-level array named decGPA,and initialize the array with the following values: 2.58,3.85,3.6,1.45,2.75.Then write a statement to assign the number 2.55 to the last element in the array.