wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Text File Pop Quiz

Total questions: 12

Worksheet time: 9mins

Name
Class
Date
1.

Text files are often used for a variety of purposes in programming, including ...

a)

Storage

b)

Processing Images

c)

Creating Code

d)

Connecting to a databse

2.

What application would you typically open a text file in?

a)

MS Word

b)

Notepad

c)

MS Excel

d)

Delphi

3.

What extension will a text file have?

a)

.wrd

b)

.text

c)

.txt

d)

.tfile

4.

Which line of code would you use to display a text file using a TMemoBox component?

a)

Memo1.Lines.SaveToFile('MyTextFile.txt');

b)

RichEdit1.Lines.SaveToFile('MyTextFile.rtf');

c)

Memo1.Lines.LoadFromFile('MyTextFile.txt');

d)

RichEdit1.Lines.LoadFromFile('MyTextFile.rtf');

5.

Which line of code would you use to save a text file using a TRichEdit component?

a)

Memo1.Lines.SaveToFile('MyTextFile.txt');

b)

RichEdit1.Lines.SaveToFile('MyTextFile.rtf');

c)

Memo1.Lines.LoadFromFile('MyTextFile.txt');

d)

RichEdit1.Lines.LoadFromFile('MyTextFile.rtf');

6.

What is happening in the line of code below?

Var
     <fileVariableName>: Textfile;

a)

We are writing to a text file.

b)

We are creating a report from a text file.

c)

We are writing a report to a text file.

d)

We are declaring our text file as a variable.

7.

Which of the following is/are an example/s of a delimiter used in a text file?

a)

Tab

b)

Semi-colon

c)

Comma

d)

Colon

8.

The ____ marker separates the rows of data, and the ___ marker signals the end of the entire file.

a)

<eol>, <csv>

b)

<eoln>, <eof>

c)

<eof>, <eof>

d)

<eof>, <eof>

9.

What is the purpose of the redOut.Clear procedure?

a)
  • To terminate the application.

b)

To clear all text from the form's RichEdit control.

c)
  • To close an open file.

d)
  • To terminate the application.

10.

What does #9 do in the following code?

redDisplay.Lines.Add(#9+'Songs'+#9+'Number of Votes');

a)

Inserts a variable

b)

Inserts a tab

c)

Inserts a comma

d)

Inserts a line break

11.

What does "arr" refer to in the following code?

redDisplay.Lines.Add(#9+arrSongs[i]+#9+inttostr(arrCount[i]));

a)

The loop to be used

b)

The text file being used

c)

The count of repetitions

d)

The array being used

12.

What does it mean to open a file in "append mode"?

a)
  • It opens the file for reading only.

b)
  • It overwrites any existing data in the file.

c)

It adds new data to the end of the file.

d)
  • It adds new data to the beginning of the file.