File Handling Flashcards

1
Q

o Temporary storage
o Example: storing a value in a variable
o The value you store is lost when the program
ends or the computer loses power.
o Volatile storage

Understanding Computer Files

A

Random access memory (RAM)

Understanding Computer Files

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

o Permanent Storage
o Non - Volatile Storage
o Example: saving a program to disk
o The value you store is not lost when a
computer loses power

Understanding Computer Files

A

Permanent storage

Understanding Computer Files

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

What are the two Broad Categories of Files?

Understanding Computer Files

A

Text file and Binary file

Understanding Computer Files

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

What is the type of file that fits the following descriptions?
* contain data that can be read in a text editor
* the data has been encoded using a scheme such as
ASCII Code or Unicode.
* includes facts and figures such as employee numbers,
names and salaries

Understanding Computer Files

A

Text file

Understanding Computer Files

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

What is the type of file that fits the following descriptions?
* Contains data that has not been encoded as text
* Examples images and music.

Understanding Computer Files

A

Binary file

Understanding Computer Files

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

____ have many common characteristics:
* Each has a Name
includes a dot (.) and a file extension that describes
the type of the file.
* Each has specific time of creation and last modified.
* Each has Size measured in bytes.
A byte is a small unit of storage.

Understanding Computer Files

A

Files

Understanding Computer Files

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

Computer Files on storage devices are the electronic equivalent of paper files stored in a file cabinets.
* For a (________) placing a paper documents in a folders and most computer users organize their files into
folders or directories.

Organizing Files

A

Better organization

Organizing Files

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

What tools are the folowing?

  • Organization units on storage devices
  • Each can contain multiple files

Organizing Files

A

Directories and Folders

Organizing Files

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

What type of hierarchy is this?

Describes the relationships between data components
Consists of:
* Characters
* Fields
* Records
* Files

Understanding the Data Hierarchy

A

Data Hierarchy

Understanding the Data Hierarchy

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

What is the term used to describe the following?

o Letters, numbers and special symbols
o Can type from a keyboard in one stroke (including
a space and tab)
o Made up of smaller elements called bits

Understanding the Data Hierarchy

A

Characters

Understanding the Data Hierarchy

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

What is the term used to describe the following?

o Single useful data items
o Composed of one or more characters
o Include items such as lastName, middleInitials,
streetAddress or annualSalary

Understanding the Data Hierarchy

A

Fields

Understanding the Data Hierarchy

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

What is the term used to describe the following?

  • Group of fields that go together for some logical reason.
  • A random name, address and salary aren’t very useful
  • But if they’re your name, your address, your salary then that’s* your record.*

Understanding the Data Hierarchy

A

Records

Understanding the Data Hierarchy

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

What is the term used to describe the following?

  • Group of related records

Understanding the Data Hierarchy

A

Files

Understanding the Data Hierarchy

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

What is the term used to describe the following?

  • The broadest types are files that can be used for input and files that can be used for output.
  • You declare files in the same way you declare variables and constants – by giving each file a data type and an identifier.
    Example:
    ~~~
    Declarations
    InputFile employeeData
    OutputFile updatedData
    ~~~

Performing File Operations

A

Declaring a file

Performing File Operations

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

What is the term used to describe the following?

  • The broadest types are files that can be used for input and files that can be used for output.
  • You declare files in the same way you declare variables and constants – by giving each file a data type and an identifier.
    Example:
    ~~~
    Declarations
    InputFile employeeData
    OutputFile updatedData
    ~~~

Performing File Operations

A

Declaring a file

Performing File Operations

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

What is the term used to describe the following?

o Before an application can use a data file, it must open
the file.
o Opening a file locates it on a storage device and
associates a variable name within your program with file.
open employeeData "EmployeeData.dat"

Performing File Operations

A

Opening a file

Performing File Operations

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

What is the term used to describe the following?

Before you can use stored data within a program, you must load the data into computer memory.
o You use a copy that is transferred into a memory.
o When you copy data from a file on storage device into RAM, you read from the files.
o If data items have been stored in a file and a program needs them, you can write separate programming statements to input each field.
~~~
input name from employeeData
input address from employeeData
input payRate from employeeData
~~~

Performing File Operations

A

Reading from a file

Performing File Operations

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

What is the term used to describe the following?

When you store data in a computer file on a persistent
storage device.
* Copy data from RAM to the file.
* When you write data to a file, you usually do not include
explanations that make data easier for human to interpret, you just write facts and figures.
* No column headings “The pay rate is”, or no commas, dollar signs, percent.
~~~
output name, address, payRate to
updatedData
~~~

Performing File Operations

A

Writing to a file

Performing File Operations

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

What is the term used to describe the following?

When you finish using a file, the program should close the
file.
* The file is no longer available to your application.
* When you leave a file open for no reason, you use computer resources, and your computer’s performance suffers.
Close updatedData

Performing File Operations

A

Closing a file

Performing File Operations

20
Q

What is the term used to describe the following?

When the processing is complete, the blank file retains the
original data and the blank file contains the blank data.

A Program that Performs File Operations

A

Input file
Output file
Revised data

A Program that Performs File Operations

21
Q

What is the term used to describe the following?

  • Copy that is kept in case values need to be restored to
  • their original state.
  • Called a parent file
  • Newly revised copy is a child file

Performing File Operations

A

Backup file

Performing File Operations

22
Q

What type of fle is this?

In this type of file, records are stored one after another in some order.
Records in a sequential file are organized based on the
contents of one or more fields.
* A file of employees stored in order by ID number
* A file of parts for manufacturing company stored in order by part
number

* A file of customers for a business stored in alphabetical order by
last name

Understanding Sequential Files and Control Break Logic

A

Sequential file

Understanding Sequential Files and Control Break Logic

23
Q

What type of fle is this?

In this type of file, records are stored one after another in some order.
Records in a sequential file are organized based on the
contents of one or more fields.
* A file of employees stored in order by ID number
* A file of parts for manufacturing company stored in order by part
number

* A file of customers for a business stored in alphabetical order by
last name

Understanding Sequential Files and Control Break Logic

A

Sequential file

Understanding Sequential Files and Control Break Logic

24
Q

What is the term used to describe this?

Temporary detour in the logic of a program.

Understanding Sequential Files and Control Break Logic

A

Control break

Understanding Sequential Files and Control Break Logic

25
Q

Change in the value of a variable initiates special actions or causes special or unusual processing to occur.
To organize output for programs that handle data records organized logically in groups based on the value in a field.

Understanding Sequential Files and Control Break Logic

A

Control break program

Understanding Sequential Files and Control Break Logic

26
Q

What type of report is this?

Examples of blank reports
* All employees listed in order by department number, with a new page
started for each department
* All books for sale in a bookstore listed in order by category (such as
reference or self-help), with a count following each category of book
* All items sold in order by date of sale, with a different ink color for each
new month

Understanding Sequential Files and Control Break Logic

A

Control break reports

Understanding Sequential Files and Control Break Logic

27
Q

What is the term used to describe this?

  • Listed in order by specific variable: state, department, category, or date.
  • The program takes special action: starts a new page, prints a count or total, or switches ink color.

Understanding Sequential Files and Control Break Logic

A

Control break program

Understanding Sequential Files and Control Break Logic

28
Q

What is the term used to describe this?

  • a break in the logic of the program that is based on the value of a single variable.
  • When you read a record which is not the same value, before you read the next value, you need to reset the counter to 0 so it is ready to start counting new value

Understanding Sequential Files and Control Break Logic

A

Single-level control break

Understanding Sequential Files and Control Break Logic

29
Q

What is the term used to describe this?

  • To hold the previous state
  • As you read each new record, comparing the new and old value determines when it is time to output the count for the previous value.

Understanding Sequential Files and Control Break Logic

A

Control break field

Understanding Sequential Files and Control Break Logic

30
Q

What is the term used to describe this?

  • To hold the previous state
  • As you read each new record, comparing the new and old value determines when it is time to output the count for the previous value.

Understanding Sequential Files and Control Break Logic

A

Control break field

Understanding Sequential Files and Control Break Logic

31
Q

What is the term used to describe this?

Combining two or more files while maintaining the
sequential order

Merging Sequential Files

A

Merging files

Merging Sequential Files

32
Q

What is the term used to describe this?

  • File of current employees in ID number order and a file
    of newly hired employees, also in ID number order
  • File of parts manufactured in the Northside factory in
    part-number order and a file of parts manufactured in the
    Southside factory, also in part-number order

Merging Sequential Files

A

Merging files

Merging Sequential Files

33
Q

Mainline logic similar to other file-processing programs, except
for handling blank files
With blank input files, must determine when both files are at
eof
* Define a flag variable to indicate that both files have
reached eof
* Must define two input files
* Read one record from each input file

Merging Sequential Files

A

Two

Merging Sequential Files

34
Q

What are the two related files have a master-transaction relationship?

Master and Transaction File Processing

A

Master file and Transaction file

Master and Transaction File Processing

35
Q

What type of file is this?

Holds relatively permanent data

Master and Transaction File Processing

A

Master file

Master and Transaction File Processing

36
Q

What type of file is this?

Contains temporary data to be used to update the
master file

Master and Transaction File Processing

A

Transaction file

Master and Transaction File Processing

37
Q

What type of file is this?

You gather transactions for a period of time, store then in a
file, use them to update matching records in a master file.

o Make changes to the values in its field based on the
recent transactions

Master and Transaction File Processing

A

Update the master file

Master and Transaction File Processing

38
Q

What is this an example of?

Library maintains a master file of all patrons and a
transaction file with information about each book or
other items checked out
o A college maintains a master file of all students and a
transaction file for each course registration
o A telephone company maintains a master file for every
telephone line (number) and a transaction file with
information about every call

Master and Transaction File Processing

A

Update the master file

Master and Transaction File Processing

39
Q

What is this an example of?

What are the two approaches in updating a file?

Master and Transaction File Processing

A

Change information in master file
* Copy master file and change new version.
o Parent version store for a period of time.
o Child version becomes the new master file.
Begin with both files sorted in the same order on the
same field

Master and Transaction File Processing

40
Q

What is this an example of?

Involves performing the same tasks with many
records, one after the other
o It really doesn’t matter whose data is produced first,
because none are distributed until all have been
printed.
o Uses sequential files

Random Access Files

A

Batch processing

Random Access Files

41
Q

What is this an example of?

What are the 2 things included in batch processing?

Random Access Files

A

Real-time applications and Interactive program

Random Access Files

42
Q

What is this an example of?

In batch processing, this requires that a record be accessed immediately while a client is waiting

Random Access Files

A

Real-time applications

Random Access Files

43
Q

What is this an example of?

In batch processing, this program in which the user makes direct request

Random Access Files

A

Interactive program

Random Access Files

44
Q

What is this an example of?

Records can be located in any order

Random Access Files

A

Random access files

Random Access Files

45
Q

What is this an example of?

These are files in which records must be accessed
immediately.

Random Access Files

A

Instant access files

Random Access Files

46
Q

What is this an example of?

What is this step in random access files?
* Associate this name with a stored file similarly to how you associate an identifier with sequential input and output files.
* You can use read, write, and close operations with a random access file similarly to the way you use them with sequential files.

randomFile customerFile

Random Access Files

A

Declare

Random Access Files

47
Q

What is this an example of?

What is this step in random access files?
* You have the additional capability to find a record directly
* You might be able to use a statement similar to the following to find customer number 712 on a random access file:

seek record 712

Random Access Files

A

Seek

Random Access Files