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
Q13: A file is like a stream of
Q14: An application must first _a file before
Q15: When opening a file, use this method
Q16: The method writes data to a file,
Q17: The StreamReader.Read method will _.
A) read the
Q19: In order to retain data while a
Q20: The following statements describe advantages of the
Q21: This predefined constant moves the print position
Q22: What does the following line do? Do
Q23: This method is used to add more
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