Introduction To Programming Using Visual Basic 10th Edition Schneider Test Bank
Introduction To Programming Using Visual Basic 10th Edition Schneider Test Bank
com
https://testbankfan.com/product/introduction-to-programming-
using-visual-basic-10th-edition-schneider-test-bank/
OR CLICK BUTTON
DOWLOAD NOW
https://testbankfan.com/product/introduction-to-programming-using-
visual-basic-10th-edition-schneider-solutions-manual/
testbankfan.com
https://testbankfan.com/product/introduction-to-programming-using-
visual-basic-2012-9th-edition-schneider-test-bank/
testbankfan.com
https://testbankfan.com/product/introduction-to-programming-using-
visual-basic-2012-9th-edition-schneider-solutions-manual/
testbankfan.com
https://testbankfan.com/product/marketing-canadian-4th-edition-grewal-
test-bank/
testbankfan.com
Our Origins Discovering Physical Anthropology 3rd Edition
Larsen Test Bank
https://testbankfan.com/product/our-origins-discovering-physical-
anthropology-3rd-edition-larsen-test-bank/
testbankfan.com
https://testbankfan.com/product/sales-management-1st-edition-tanner-
test-bank/
testbankfan.com
https://testbankfan.com/product/western-civilization-beyond-
boundaries-volume-i-to-1715-7th-edition-noble-test-bank/
testbankfan.com
https://testbankfan.com/product/governmental-and-nonprofit-
accounting-11th-edition-freeman-test-bank/
testbankfan.com
https://testbankfan.com/product/psychology-and-the-challenges-of-
life-13th-edition-nevid-solutions-manual/
testbankfan.com
Law of Marketing 2nd Edition Oswald Test Bank
https://testbankfan.com/product/law-of-marketing-2nd-edition-oswald-
test-bank/
testbankfan.com
Chapter 7 Arrays
1. After the following Dim statement is executed, how many elements will the array myVar
have?
Dim myVar(7) As Double
(A) 0
(B) 1
(C) 8
(D) 9
C
4. In the statement
Dim scores(30) As Double
the Count method is used to carry out which of the following tasks?
(A) determine the largest value for each of the elements
(B) determine the largest subscript in the array
(C) determine the smallest value for each of the elements
(D) declare a new array with the name Count
B
8. The ReDim statement causes an array to lose its current contents unless the word ReDim is
followed by the keyword
(A) CInt
(B) MyBase
(C) Preserve
(D) Add
C
9. Like other variables, array variables can be declared and assigned initial values at the same
time. (T/F)
T
10. After an array has been declared, its type (but not its size) can be changed with a ReDim
statement. (T/F)
F
11. If you use the ReDim statement to make an array smaller than it was, data in the eliminated
elements can be retrieved by using the Preserve keyword. (T/F)
F
13. What will be the size of the array stones after the following two lines of code are executed?
Dim stones() As String = {"Watts", "Jagger", "Wood", "Richards"}
ReDim Preserve stones(10)
11
is used to declare an array where each element has the value 10. (T/F)
F
17. What two names are displayed in the list box when the button is clicked on?
Dim krispies(2) as String
19. Either a For...Next loop or a For Each loop can be used to display every other value from an
array in a list box. (T/F)
F
20. An array can contain both numeric and string values. (T/F)
F
21. A Function procedure can return a number, but cannot return an array of numbers. (T/F)
F
22. What names are displayed in the list box when the button is clicked on?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim names() As String = IO.File.ReadAllLines("Data.txt")
lstBox.Items.Clear()
For i As Integer = (names.Count - 1) To 0 Step -2
lstBox.Items.Add(names(i))
Next
End Sub
Assume the five lines of the file Data.txt contain the following entries: Bach, Borodin,
Brahms, Beethoven, Britain.
(A) Bach, Brahms, and Britain
(B) Britain, Beethoven, Brahms, Borodin, and Bach
(C) Bach, Borodin, Brahms, Beethoven, and Britain
(D) Britain, Brahms, and Bach
D
24. What numbers are displayed in the list box when the button is clicked on?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim file As String = "Beatles.txt"
Dim fabFour() As String = FillArray(file)
lstBox.Items.Add(Array.IndexOf(fabFour, "Ringo")
lstBox.Items.Add(fabFour.Count - 1)
End Sub
Assume the four lines of the file Beatles.txt contain the following entries: John, Paul, Ringo,
George.
(A) 3 and 3
(B) 3 and 4
(C) 2 and 3
(D) 2 and 4
C
26. What numbers are displayed in the list box by the following program segment?
Dim numbers As String = "1492,1776,1945"
Dim temp() As String = numbers.Split(","c)
Dim nums(2) As Integer
For i As Integer = 0 to 2
nums(i) = CInt(temp(i))
Next
lstBox.Items.Add(nums(1))
lstBox.Items.Add(nums.First)
(A) 10000
(B) 11110
(C) 1110
(D) 0
B
30. Given the Dim statement below, which set of statements will initialize all elements of
myArray to 100?
Dim myArray(100) As Double
34. Consider the following Dim and assignment statements for myArray(). The assignment
statement will cause a "Subscript out of range" error. (T/F)
Dim myArray(50) As Double
myArray(34) = 51
F
35. Unless otherwise specified, Visual Basic assigns the value 0 to each element of a numeric
array when it is declared with a Dim statement. (T/F)
T
39. Which of the tasks is the Join function used to carry out in the following statement?
Dim line As String
line = Join(strArrData, ",")
(A) Join concatenates the values of all elements of the array strArrData, and adds a comma
delimiter between successive values.
(B) Join concatenates the values of all elements of line, and adds a comma to the end of the
line.
(C) Join parses or separates out all items of text that are delimited by a comma in
strArrData.
(D) Join parses or separates out all items of text that are delimited by a comma in line.
A
2. What numbers are displayed in the list box by the following program segment?
Dim numbers() As Integer = {4, 7, 9, 3, 1}
Dim query = From number in numbers
Where number > 6
Select number
lstBox.Items.Add(query.Count)
lstBox.Items.Add(query.Average)
(A) 5 and 12
(B) 2 and 12
(C) 2 and 8
(D) 5 and 8
C
3. What numbers are displayed in the list box by the following program segment?
Dim numbers() As Integer = {4, 7, 9, 3, 1, 9, 7}
Dim query = From number in numbers
Where number > 6
Select number
lstBox.Items.Add(query.Count)
lstBox.Items.Add(query.Average)
(A) 7 and 12
(B) 4 and 8
(C) 2 and 12
(D) 7 and 8
B
5. What states are displayed in the list box by the following program segment?
Dim states() As String = {"Colorado", "New Mexico", "Arizona", "Utah"}
Dim query = From state in states
Where ContainsE(state)
Select state
For Each state in query
lstBox.Items.Add(state)
Next
(A) Utah
(B) COLORADO, NEW MEXICO, ARIZONA, UTAH
(C) UTAH
(D) No states
C
7. What numbers are displayed in the list box by the following program segment?
Dim states() As String = {"Colorado", "New Mexico", "Arizona", "Utah"}
Dim query = From state in states
Where state.EndsWith("o")
Select state.Length
For Each number in query
lstBox.Items.Add(number)
Next
(A) 8 and 10
(B) 8, 10, 7, 4
(C) 8
(D) 29
A
8. What names are displayed in the list box by the following program segment?
Dim tonightShow() As String = {"Allen", "Parr", "Carson", "Leno",
"O'Brien", "Leno"}
Dim query = From host in tonightShow
Where host.Length = 4
Select host
Distinct
For Each host in query
lstBox.Items.Add(host)
Next
10. What years are displayed in the list box by the following program segment?
Dim years() As Integer = {1492, 1776, 1840, 1929, 1945, 2005}
Dim query = From year in years
Where Is20thCentury(year)
Select year
For Each yr in query
lstBox.Items.Add(yr)
Next
12. What words are displayed in the list box by the following program segment?
Dim deadlySins() As String = {"pride", "greed", "anger", "envy",
"lust", "gluttony", "sloth"}
Dim query = From sin in deadlySins
Order By sin Ascending
Where sin.StartsWith("g")
Select sin
lstBox.Items.Add(query.First)
lstBox.Items.Add(query.Max)
13. What words are displayed in the list box by the following program segment?
Dim deadlySins() As String = {"pride", "greed", "anger", "envy",
"lust", "gluttony", "sloth"}
Dim query = From sin in deadlySins
Order By sin.Length Descending
Select sin.ToUpper
lstBox.Items.Add(query.First)
lstBox.Items.Add(query.Min)
»Hans, sage mal, was treibst Du hier draußen! Mama ist schon zu
Bett. Seit einer Stunde sitzest Du hier!«
Hans Henning fuhr auf. »Seit seiner Stunde –?«
»Junge, fehlt Dir etwas? Wie Deine Hände heiß sind! Warum
kamst Du nicht mit herein?«
»Ich – weiß nicht. Ich habe mich wohl hier verträumt.«
»Hans – sag mir mal die Wahrheit. Du bist wohl verliebt?«
Sie standen jetzt beide beieinander. Es war zu dunkel, als daß sie
ihre Gesichter sehen konnten. Wie stark der Wind gewachsen war!
Es war ein Sausen und Brausen in den Bäumen des Gartens.
»Ich bin Dein Bruder, mein Junge«, sagte Gregor. »Du kannst Dich
mir vertrauen.«
»Ja!« rief Hans Henning aus. Es war ein Ton des lautersten
Frohlockens.
»Gregor – ich – siehst Du –«
Nein, es ging doch nicht. Hans sah verzweifelt zur Seite. Wie
macht man es denn, daß man so etwas sagt?
»Es ist wohl Frida Dörfflin, um die es sich handelt«, sagte Gregor
in völliger Gelassenheit.
Hans Henning antwortete nicht, das Herz schlug ihm bis zum
Halse. Wie hatte die Nennung dieses Namens ihn durchschnitten!
Wie konnte es nur so unsinnig weh tun, den Namen so kühl wie
geschäftsmäßig nennen zu hören.
Gregor genügte wohl diese stumme Antwort. Er schwieg einen
Moment.
»Das Kind!« sagte er dann in wegwerfendem Ton.
Hans Henning schoß das Blut wild ins Gesicht.
»Was meinst Du damit? Ich lasse nicht an ihr rühren.«
»Wer tut denn das?« sagte Gregor nachlässig. »Meinst Du etwa,
sie sei kein Kind mehr? Verstehst Du Dich so wenig auf
Menschenaugen? Bei diesem Mädchen ist alles noch Klarheit,
Harmlosigkeit und ein vollständiges Spielen dem Leben gegenüber.
Ich spreche das nicht als Tadel aus, sondern nenne es einen
Vorzug.«
»Ich habe das auch schon gedacht«, murmelte Hans. Da stand er
ja mit einem Male mitten in Frage und Antwort, Bitte und Rat, wie er
es sich noch vorhin so sehr gewünscht hatte. Nur daß es nicht die
Mutter war. Aber vielleicht wußte Gregor noch mehr von diesen
Dingen.
»Ich dachte sonst – ich wollte morgen, vor der Abreise –«,
stotterte der große Junge. »Ich will ja auch gar nichts an ihr
zerstören, Gregor. Ich will ihr gar nicht viel von Liebe vorschwatzen.
Nur wissen – ob sie mein Kamerad sein will – diese Ungewißheit,
Gregor, die ist ja zu gräßlich –«
Gregor wandte sich ab und ging mit starken Schritten zweimal die
Veranda auf und nieder. Dann blieb er vor Hans stehen, und als er
sprach, klang seine Stimme wie geschliffener Stahl.
»Ihr seid beide noch Kinder. Durchbrich diesen Zustand nicht aus
Übermut. Du schadest ihr und Eurem ganzen Verhältnis, Du
veranlassest sie, sich zu verschenken, ehe sie sich kennt. Glaubst Du
nicht, Hans, daß das eine Sünde an ihrem Geist und Wesen ist?
Lerne warten, mein Junge, überlaß diese Sache der Zeit, bis die
Blumen von selber aufbrechen.«
»Ist das so –?« stotterte Hans.
»Ja, Hans Henning, das ist so!« sagte Gregor.
Sein Ton legte sich wie eine eiskalte Hand dem Jüngling aufs Herz.
– Hatte er vielleicht doch nur nach Hilfe verlangt, um die Antwort zu
hören, die er wünschte?
Oder ahnte sein erwachtes Herz das Schwert in des Bruders
weisem und wohlbegründetem Rat? Seine Lippen bebten, als er
sagte: »Ich danke Dir. Ich will jetzt schlafen gehen!«
Er ging. Die Sporen klirrten leise. In dem erleuchteten Zimmer sah
er im Spiegel sein Bild vorübergleiten. – »Überlaß es der Zeit –«
Vielleicht hat er recht, und ich handle verrucht, seine Worte zu
verachten. Vielleicht bin ich ein Narr, wenn ich es nicht tue. Ich bin
nicht weiter als zuvor.
Überlaß es der Zeit!
Ja, Du kaltes Herz, Dir steht es wohl an, so zu sprechen. – Aber
hat ein heißes Herz mehr Recht und weiteren Blick?
Das wird heute eine friedvolle Nacht!
Gregor stand noch draußen. Das Gewitter hatte sich verzogen
oder war landeinwärts niedergegangen. Es blitzte nicht mehr. Nur
ein leichter Regen, durch den Wind hin- und hergetrieben, sprühte
durch die Bogenöffnung der Veranda und tanzte oben auf dem
Glasdach. Die Luft war stark abgekühlt.
Er stand eine kurze Weile und sah hinaus. Noch lagen seine
eigenen klingenden Worte ihm im Ohr. »Überlaß es der Zeit, bis die
Blumen von selber aufbrechen.«
testbankfan.com