Exam 8: Text Files

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

In the line of code sw = IO.File.CreateText(fileName) sw is a variable that holds the value of a filespec for an existing text file.

(True/False)
4.8/5
(38)

Element names are case sensitive.

(True/False)
4.8/5
(38)

Each line of the file UN.txt contains four pieces of information (name, continent, population in millions, area) about one of the 192 member countries of the United Nations. The first two lines of the file are Afghanistan,Asia,28.2,251772 Albania,Europe,3.2,11100 What is the first line of the file created by the following code? Dim query = From line In IO.File.ReadAllLines("UN.txt") Let data = line.Split(","c) Let country = data(0) Let population = 1000000 * CDbl(data(2)) Let area = CDbl(data(3)) Let density = population / area Select country & "," & density.ToString("N1") IO.File.WriteAllLines("NewFile.txt", query)

(Multiple Choice)
4.8/5
(39)

When you place the OpenFileDialog control on a form, it will not be visible on the form.

(True/False)
5.0/5
(38)

The following statements are valid. Dim filespec As String filespec = InputBox ("Enter name of file to process:") Dim sr As IO.StreamReader = IO.File.OpenText (filespec)

(True/False)
4.7/5
(44)

Opening a file for output means that

(Multiple Choice)
4.8/5
(37)

Which of the following exceptions will be generated by trying to access a disk drive that doesn't contain a disk?

(Multiple Choice)
4.8/5
(40)

The value of sr.EndOfStream is True when the end of file accessed by the StreamReader is reached.

(True/False)
4.7/5
(45)

An individual item of a text file cannot be changed or deleted directly.

(True/False)
4.8/5
(41)

Elements in an XML document can contain other elements.

(True/False)
4.7/5
(34)

The acronym CSV stands for "Comma Separated Values".

(True/False)
4.8/5
(33)

When a file is opened for Append,

(Multiple Choice)
4.7/5
(33)

A statement of the form IO.File.WriteAllLines("fileName.txt", numArray) copies the contents of the numeric array numArray into a text file.

(True/False)
4.9/5
(26)

Comment statements in XML begin with

(True/False)
5.0/5
(44)

Placing the statement Imports System.IO near the top of the Code Editor (before the Class frmName statement) simplifies file handling by eliminating the need to use the words StreamReader, StreamWriter, and File in your code.

(True/False)
4.7/5
(31)

The following statement causes the Open dialog box to become visible on the form. OpenFileDialog1.ShowDialog After a file has been selected and the Open button is pressed, the value of OpenFileDialog1.FileName will be the file's filespec; this will include all of the following except

(Multiple Choice)
5.0/5
(28)

The XML standard was recommended by the World Wide Web Consortium.

(True/False)
4.8/5
(39)

Which of the following statements is used when you want to add data to the end of an existing text file?

(Multiple Choice)
4.8/5
(36)

An XML file can contain several root elements.

(True/False)
4.9/5
(46)

Opening a file for input means that

(Multiple Choice)
4.8/5
(33)
Showing 41 - 60 of 65
close modal

Filters

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