Exam 8: Text Files

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Before a text file can be opened for input, it must already exist on a disk.

Free
(True/False)
4.8/5
(32)
Correct Answer:
Verified

True

If a text file is opened for input, then this allows

Free
(Multiple Choice)
4.7/5
(40)
Correct Answer:
Verified

B

The catch block: Catch exc As IO.IOException handles which of the following exceptions?

Free
(Multiple Choice)
4.7/5
(46)
Correct Answer:
Verified

B

The characters < and & cannot appear in the content of an element of an XML file.

(True/False)
4.8/5
(43)

In a Try-Catch-Finally block, the code in the Finally block is always executed, regardless of whether an exception was thrown.

(True/False)
4.8/5
(28)

Which of the following statements will result in an IndexOutOfRangeException if placed after the following line of code? Dim arr(2) As Integer

(Multiple Choice)
4.8/5
(43)

A Catch block of code that is initiated by the keyword Catch and doesn't contain any additional terms will execute regardless of whether an exception occurred.

(True/False)
4.8/5
(47)

In a Try-Catch-Finally block, if there are multiple Catch blocks, the code in the last listed Catch block is always executed.

(True/False)
4.9/5
(45)

Each element of an XML document must contain both a start tag and an end tag.

(True/False)
4.8/5
(33)

The line of code sw.Close when used with the line sw = IO.File.CreateText(fileName) completes which of the following tasks?

(Multiple Choice)
4.9/5
(40)

Text files are updated by opening them for Input and then entering the new data.

(True/False)
4.8/5
(26)

When an exception is generated by a Visual Basic application, the default exception handler will

(Multiple Choice)
4.9/5
(32)

A text file cannot be open both for input and for output at the same time.

(True/False)
4.7/5
(31)

In a Try-Catch-Finally block, the Catch clauses are considered one at a time, in the order in which they appear in the code, until the proper exception is located.

(True/False)
4.8/5
(42)

The code in a Try block refers to a file and the first catch block is written as follows: Catch exc As IO.IOException The second catch block is written with the following clause: Catch What type of exception will this second Catch block handle?

(Multiple Choice)
4.9/5
(38)

In the following statement, sw is the name of a variable. Dim sw As IO.StreamWriter = \quad \quad \quad \quad \quad IO.File.CreateText ("C:\TEXT FILES\INCOME Data.txt")

(True/False)
4.8/5
(40)

End tags always begin with a less than symbol followed by a forward slash.

(True/False)
4.8/5
(35)

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

(Multiple Choice)
4.7/5
(36)

If an attempt is made to access a file within a missing folder using the OpenText method, the IO.DirectoryNotFoundException will be thrown.

(True/False)
5.0/5
(34)

If any record in a text file is to be changed, the entire file must be rewritten.

(True/False)
4.9/5
(36)
Showing 1 - 20 of 65
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)