Multiple Choice
Assume the file Alphabet.txt contains 26 records, the lowercase letters of the alphabet in ascending order. What happens when the following code is executed?
Dim letter As String
Dim sr As IO.StreamReader = IO.File.OpenText("Alphabet.txt")
Do While Not sr.EndOfStream
Dim sw As IO.StreamWriter = IO.File.CreateText(letter.ToUpper & ".txt") letter = sr.ReadLine
sw.WriteLine(letter.ToUpper & ".txt")
sw.Close
Loop
sr.Close
A) A "too many files open" error is produced.
B) Twenty-six files are created and named with one of the uppercase letters of the alphabet and each containing only its own file name.
C) A file called z is created containing all of the letters of the alphabet in lowercase.
D) An "invalid file name" error is produced.
Correct Answer:

Verified
Correct Answer:
Verified
Q13: A text file cannot be open both
Q14: In a Try-Catch-Finally block, the Catch clauses
Q15: The code in a Try block refers
Q16: In the following statement, sw is
Q17: End tags always begin with a less
Q19: If an attempt is made to access
Q20: If any record in a text file
Q21: In order to use the OpenFileDialog control,
Q22: Each record of the file UN.txt contains
Q23: If the value of IO.File.Exists(filespec) is True,