Principles of programming CH. 7,8,9 – Flashcards

Unlock all answers in this set

Unlock answers
question
To generate a control break report, your input records must be organized in ____ order based on the field that will cause the breaks.
answer
sequential
question
You can merge more than two files.
answer
true
question
The ____ file holds temporary data that is used to update the master file.
answer
transaction
question
When the records in a file are sorted in order from lowest to highest values, the records are in ____ order.
answer
ascending
question
The combination of the disk drive plus the complete hierarchy of directories in which a file resides is its ____.
answer
path
question
Directories and ____ are organization units on storage devices.
answer
folders
question
____ is processing that involves performing the same tasks with many records, one after the other.
answer
Batch processing
question
Is not lost when a computer loses power
answer
nonvolatile storage
question
Is lost when the program ends or the computer loses power
answer
volatile storage
question
Thousands of bytes
answer
kilobytes
question
Millions of bytes
answer
megabytes
question
Billions of bytes
answer
gigabytes
question
Letters, numbers, and special symbols, such as "A", "7", and "$"
answer
character
question
Single useful data items that are composed of one or more characters
answer
fields
question
Groups of related records
answer
files
question
Holds complete and relatively permanent data
answer
master file
question
A file in which records can be located in any order
answer
random access file
question
____ storage is not lost when a computer loses power.
answer
permanent
question
____ is the more general term for an entity that organizes files.
answer
Directory
question
Because they enable you to locate a particular record directly (without reading all of the preceding records), random access files are also called ____ files.
answer
direct access
question
Images and music are contained in binary files.
answer
true
question
When you copy data from RAM into a file on a storage device, you read to the file.
answer
false
question
A ____ break is a break in the logic of the program that is based on the value of a single variable.
answer
single-level control
question
When you write a program that stores a value in a variable, you are using ____ storage.
answer
temporary
question
A database holds groups of files or ____ that together serve the information needs of an organization.
answer
tables
question
When you store data records, they exist in ____.
answer
some type of order
question
As pages in a book have numbers, computer memory and storage locations have ____.
answer
addresses
question
When you create a ____ report, the records must have been sorted in order by a key field.
answer
control break
question
When mathematicians use a two-dimensional array, they often call it a ____ or a table.
answer
matrix
question
When you use an index, you can store records on a ____ storage device.
answer
random-access
question
When computers sort data, they always use ____ values when making comparisons between values.
answer
numeric
question
A bubble sort is sometimes called a ____.
answer
sinking sort
question
A record's ____ field is the field whose contents make the record unique among all records in a file.
answer
key
question
To correctly swap two values, you create a(n) ____ variable to hold one of the values.
answer
temporary
question
The ____ is often used as a statistic in many cases because it represents a more typical case.
answer
median
question
When a large data file needs to be processed in ascending or descending order based on a particular field, the most efficient approach is usually to store and access records based on their logical order.
answer
true
question
It is relatively easy for people to keep track of arrays with more than three dimensions.
answer
false
question
In a(n) ____, if an element is out of order relative to any of the items earlier in the list, you move each earlier item down one position and then insert the tested element.
answer
insertion sort
question
____ are arrays that have more than one dimension.
answer
Multidimensional arrays
question
Each element in a two-dimensional array requires ____ subscript(s) to reference it.
answer
two
question
When using a bubble sort to sort a 10-element array, on the fourth pass through the array list you detect that no swap has occurred. This indicates ____.
answer
all elements in the array are already in the correct order
question
The input value that makes the recursion stop is called the base case or ending case.
answer
False
question
When you ____ a method, you write multiple methods with a shared name but different parameter lists.
answer
overload
question
When a data item is known to all of a program's modules, it is a ____data item.
answer
global
question
A program module that contains a series of statements that carry out a task
answer
method
question
The declaration or definition
answer
method header
question
A copy of a variable's value is sent to the method and stored in a new memory location accessible to the method
answer
passed by value
question
A new memory location is reserved and named
answer
redeclared
question
The arguments sent to a method in a method call
answer
actual parameters
question
When the method receives the actual memory address of the array and has access to the actual values in the array elements
answer
passed by refference
question
The ability of a method to act appropriately according to the context
answer
polymorphism
question
When all the operations in a method contribute to the performance of a single task
answer
functionally cohesive
question
Occurs when methods have access to the same globally defined variables
answer
tight coupling
question
Occurs when a copy of data that must be shared is passed from one method to another
answer
loose coupling
question
In implementation hiding, the calling method needs to understand only the interface to the method that is called and it need not know how the method works internally.
answer
true
question
The method name and parameter list constitute the ____.
answer
signature
question
____ occurs when methods excessively depend on each other and makes programs more prone to errors.
answer
Tight coupling
question
Variables and constants are ____ within, or local to, only the method in which they are declared.
answer
in scope
question
You can think of the ____ in a method declaration as a funnel into the method.
answer
parentheses
question
A method can return nothing, in which case the method is a ____ method.
answer
void
question
A method's return type is part of its signature.
answer
false
question
____ is a measure of the strength of the connection between two program methods.
answer
coupling
question
When methods must share data, you can pass the data into and return the data out of methods.
answer
true
question
Arrays, unlike simple built-in types, are passed by ____.
answer
reference
question
Every time you call a method, the address to which the program should return at the completion of the method is stored in a memory location called the ____.
answer
stack
question
____ refers to how the internal statements of a method serve to accomplish the method's purpose.
answer
cohesion
question
____ is the ability of a method to act appropriately depending on the context.
answer
Polymorphism
question
A method that calls itself is a ____.
answer
recursive method
question
The saved version of a master file is the ____ file; the updated version is the child file.
answer
parent
question
A ____ is a copy that is kept in case values need to be restored to their original state.
answer
backup file
question
When you ____ a file, it is no longer available to your application.
answer
close
question
A ____ is a temporary detour in the logic of a program.
answer
control break
question
Characters are made up of smaller elements called ____.
answer
bits
question
____ files involves combining two or more files while maintaining the sequential order.
answer
merging
question
When you learn a method like sorting, programmers say you are learning a(n) ____.
answer
algorithm
question
The ____ is skewed by a few very high or low values.
answer
mean
question
Because "A" is always less than "B", alphabetic sorts are ____ sorts.
answer
ascending
question
In a ____, items in a list are compared with each other in pairs.
answer
bubble sort
question
An insertion sort is another name for a bubble sort.
answer
false
question
You can make additional improvements to a bubble sort to reduce unnecessary comparisons.
answer
true
question
A two-dimensional array contains two dimensions: ____.
answer
height and width
question
Every time you add a new record to a linked list, you search through the list for the correct ____ location of the new record.
answer
logical
question
____ occurs when a method is defined in terms of itself.
answer
Recursion
question
Each time a method executes, any parameter variables listed in the method header are ____.
answer
redeclared
question
You can invoke or call a method from another program or method.
answer
true
question
Programs that use recursion are error-prone but easy to debug.
answer
false
question
A called method accepts the value of an argument passed to it as its ____.
answer
parameter
question
A method's name and parameter list constitute the method's ____.
answer
signature
question
A method's declared return type must match the type of value used in the return statement.
answer
true
question
Using implementation hiding means that the ____ is the only part of a method with which the method's client interacts.
answer
interface to the method
question
A method could be called using any numeric value as an argument, whether it is a variable, a named constant, or a literal constant.
answer
true
question
When you copy data from a file on a storage device into RAM, you ____ from the file.
answer
read
question
Programmers usually use the word "write" to mean "produce hard copy output."
answer
false
question
When a program uses a ____, it reads all the records in the file from beginning to end, processing them one at a time.
answer
sequential file
question
In most programming languages, before an application can use a data file, it must ____
answer
open the file
question
A ____ is a collection of data stored on a nonvolatile device in a computer system.
answer
computer file
question
The terms "parent" and "child" can refer to file backup generations, but they are also used for a different purpose in object-oriented programming.
answer
true
question
____ are groups of fields that go together for some logical reason.
answer
records
question
____ applications require that a record be accessed immediately while a client is waiting.
answer
Real-time
question
One way to access records in a desired order, even though they might not be physically stored in that order, is to create a(n) ____.
answer
linked list
question
You do not need to determine a record's exact physical address in order to use it.
answer
true
question
The sorting process is usually reserved for a relatively large number of data items.
answer
false
question
When you sort records, two possible approaches are to place related data items in parallel arrays and to ____.
answer
sort records as a whole
question
The most popular computer coding schemes include ASCII, Numeric, and EBCDIC.
answer
false
question
When you ____ records, you store a list of key fields paired with the storage address for the corresponding data record.
answer
index
question
Two-dimensional arrays are never actually required in order to achieve a useful program.
answer
true
question
The last statement in a method is a(n) ____.
answer
return statement
question
When a copy of a variable is sent to a method, it is passed by ____.
answer
value
question
Programmers use the term ____ to describe any extra time and resources required by an operation.
answer
overhead
question
Files in which records must be accessed immediately are sometimes called instant access files.
answer
true
question
Files exist on ____ storage devices, such as hard disks, DVDs, USB drives, and reels of magnetic tape.
answer
permanent
question
You update the transaction file with data from the master file.
answer
false
question
To write a program that produces a report of employees by department number, the records must be grouped by department number before you begin processing.
answer
true
question
An array whose elements you can access using a single subscript is a ____ array.
answer
one-dimensional
question
Some programming languages allow multidimensional arrays.
answer
true
question
Arranging records one after another based on the value in a particular field
answer
sequential order
question
Arranging records from highest to lowest value within a field
answer
descending oder
question
The value of the middle item when the values are listed in order
answer
median
question
The arithmetic average
answer
mean
question
A two-dimensional array
answer
table
question
A "real" order for storage
answer
physical order
question
A virtual order based on any criterion you choose
answer
logical order
question
Used to identify computer memory and storage locations
answer
addresses
question
Methods with identical names that have identical parameter lists but different return types are ambiguous.
answer
true
question
A calling method sends a(n) ____ to a called method.
answer
argument
question
All modern programming languages contain many methods that are predefined.
answer
true
question
The keyboard and printer are the default input and output devices.
answer
false
question
When records are in ____ order, they are arranged one after another on the basis of the value in a particular field.
answer
sequential
question
____ refers to how the internal statements of a method serve to accomplish the method's purpose.
answer
cohesion
question
____ provide an overview of input to the method, the processing steps that must occur, and the result.
answer
IPO charts
question
____ occurs when methods do not depend on others.
answer
Loose coupling
question
Using implementation hiding means that the ____ is the only part of a method with which the method's client interacts.
answer
Interface to the method
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New