Quiz9-Files Flashcards

1
Q

In current gaming software, it is rare for data files to be needed.(T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The data saved in a file will remain there after the program ends but will be erased when the computer is turned off. (T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In a text file, all data is stored as a series characters.(T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

All types of files can be viewed correctly in a simple text editor. (T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Sequential access files are easy to work with because you can immediately jump to any piece of data without reading all the data before it.(T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The use of a buffer increases the system’s performance because writing data to memory is faster than writing data to a disk.(T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When an input file is opened, the read position is initially set to the first item in the file.(T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The term “output file” describes a file that data is read from.(T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In a file a record is a complete set of data about an item and a field is an individual piece of data within a record.(T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

It is possible to manipulate data in a file directly without saving its contents to an array or anywhere else in a program. (T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A file specification document describes the fields that are used in a file and is used to help programmers understand how the data is organized before they begin writing programs to manipulate that data.(T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Control break logic is used when the programmer wants a program to terminate immediately.(T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Programmers usually refer to the process of saving to a file as ___________ to a file.

A

Writing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When a web page is visited, the browser may store a small file on the user’s computer. This file is known as a ______________.

A

Cookie

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Opening a(n) _____________ file creates a file on disk and allows the program to write data to it.

A

Output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A character or set of characters that marks the end of a piece of data is known as a(n) _____________.

A

Delimiter

17
Q

In the ___________ step, the data is either written to the file or read from the file.

A

Processing

18
Q

Which type of file CANNOT be viewed in a text editor such as Notepad?

A

Binary file

19
Q

When using __________ access, access to the data starts at the beginning of the file and proceeds through all the records to the end of the file.

A

Sequential

20
Q

When using __________ access, the code can access any piece of data without reading all the data that came before it in the file.

A

Direct

21
Q

In the pseudocode of the textbook, what does the following statement indicate?

Declare OutputFile itemsOrdered

A) itemsOrdered is the internal name used to work with the contents of a file

B) itemsOrdered is a file on disk and the program will read data from it

D) None of these statements are true

A

A) itemsOrdered is the internal name used to work with the contents of a file

22
Q

In the pseudocode of the textbook, what does the following statement indicate?

Write itemsOrdered “widgets”

A) The file named itemsOrdered will be renamed widgets

B) The string “widgets” will be written to the file associated with itemsOrdered

C) itemsOrdered is a file on disk and the program will write the string “widgets” to it

A

B) The string “widgets” will be written to the file associated with itemsOrdered

23
Q

In order to process the data in a file, first you must ____________ the file and then ____________ the data into memory.

A) Input, Write

B) Open, loop

C) Open, Read

A

C) Open, Read

24
Q

The eof function _______________.

A) Accepts a file’s internal name as an argument and returns TRUE if the end of the file has been reached.

B) Accepts a file’s internal name as an argument and returns FALSE if the end of the file has been reached.

A

A) Accepts a file’s internal name as an argument and returns TRUE if the end of the file has been reached.

25
Q

Given the following pseudocode, what is the name of the file on the disk?

Declare String item
Declare Integer numOrdered
Declare InputFile stuffBought
Open stuffBought “inventory.dat”
Display “Your orders:”
While NOT eof(stuffBought)
Read stuffBought item, numOrdered
Display item, “: “, numOrdered
End While
Close stuffBought

A) stuffBought
B) inventory.dat

A

B) inventory.dat

26
Q

Given the following pseudocode, what is the internal name used to work with the file on disk?

Declare String item
Declare Integer numOrdered
Declare InputFile stuffBought
Open stuffBought “inventory.dat”
Display “Your orders:”
While NOT eof(stuffBought)
Read stuffBought item, numOrdered
Display item, “: “, numOrdered
End While
Close stuffBought

A) stuffBought
B) inventory.dat

A

A) stuffBought

27
Q

Which of the following expressions is equivalent to the pseudocode shown here?

NOT eof(myStuff)

A) eof(myStuff) == False

B) eof(myStuff) == True

C) not eof == myStuff

A

A) eof(myStuff) == False