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
Q13: A statement of the form IO.File.WriteAllLines("fileName.txt", numArray)
Q14: Opening a file for input means that
A)
Q15: When an existing file is opened for
Q16: In order to use the OpenFileDialog control,
Q17: When a file is opened for Append,
A)
Q19: When you place the OpenFileDialog control on
Q20: Each line of the file UN.txt contains
Q21: The following statements are valid.
Dim filespec As
Q22: In the following statement, sw is
Q23: If a text file is opened for
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents