Multiple Choice
Which of the following code segments creates a new file named address.txt, writes the following two lines to the file, and then closes the file? Bob Johnson
Somewhere USA
A) Dim addressFile As System.IO.StreamWriter addressFile = System.IO.File.CreateText("address.txt")
AddressFile.Write("Bob Johnson")
AddressFile.Write("Somewhere USA")
Address.txt.Close()
B) Dim addressFile As System.IO addressFile = System.IO.File.CreateText("address.txt")
AddressFile.WriteLine("Bob Johnson")
AddressFile.WriteLine("Somewhere USA")
AddressFile.Close()
C) Dim addressFile As System.IO.StreamWriter addressFile = System.IO.File.CreateText("address.txt")
AddressFile.WriteLine("Bob Johnson")
AddressFile.WriteLine("Somewhere USA")
AddressFile.Close()
D) Dim addressFile As StreamWriter addressFile = System.IO.File.CreateText("address.txt")
AddressFile.PrintLine("Bob Johnson")
AddressFile.PrintLine("Somewhere USA")
Close()
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Which of the following declares a structure
Q2: This method is used to add more
Q4: When a file is selected from an
Q5: Which of the following statements are not
Q6: Which of the following code segments writes
Q7: An application must first _a file before
Q8: The fields within a structure can be
Q9: An Open dialog box displays the current
Q10: What does the following line do? Do
Q11: To left justify the columns in the