COP1000 Final Exam Practice

25 July 2022
4.7 (114 reviews)
177 test answers

Unlock all answers in this set

Unlock answers (173)
question
An infinite loop is a flow of program logic that repeats and never ends.
answer
true
question
A string variable can hold digits such as account numbers and zip codes.
answer
true
question
Structured programs use spaghetti code logic.
answer
false
question
You can use parentheses to override the default order of operations.
answer
true
question
You can either increment or decrement the loop control variable.
answer
true
question
Many newer programming languages such as C++, Java, and C# use the square bracket notation for arrays.
answer
true
question
Files in which records must be accessed immediately are sometimes called instant access files
answer
True
question
It is relatively easy for people to keep track of arrays with more than three dimensions
answer
False
question
All modern programming languages contain many methods that are predefined.
answer
True
question
Class diagrams consists of a rectangle divided into three sections.
answer
true
question
Any constructor you write must have the same name as the class it constructs, and it cannot have a return type
answer
true
question
An important advantage of using GUI data-entry objects is that you often can control what users enter by limiting their options
answer
true
question
Programmers can use either procedural programming or object-oriented programming to develop programs.
answer
true
question
Modularization makes it harder for multiple programmers to work on a problem.
answer
False
question
The case structure is a variation of the sequence structure and the do loop is a variation of the while loop.
answer
False
question
When you combine AND and OR operators, the OR operators take precedence, meaning their Boolean values are evaluated first.
answer
False
question
The safest action is to assign the value 1 to accumulators before using them.
answer
false
question
Parallel arrays must contain the same data type.
answer
false
question
When you copy data from RAM into a file on a storage device, you read to the file.
answer
False
question
You do not need to determine a record's exact physical address in order to use it.
answer
True
question
A method's declared return type must match the type of value used in the return statement.
answer
true
question
The accessor method is another name for the set method.
answer
False
question
You cannot provide parameters to a destructor; it must have an empty parameter list.
answer
False
question
Multithreaded programs often run faster and they are more user-friendly.
answer
true
question
Every programming language has rules governing its word usage and punctuation.
answer
True
question
Programmers generally write programs as one long series of steps.
answer
False
question
In a structured program, any structure can be nested within another structure.
answer
true
question
When you need to satisfy two or more criteria to initiate an event in a program, you must make sure that the second decision is made entirely independently of the first decision.
answer
false
question
An indefinite loop is a loop that never stops.
answer
False
question
When you have a five element array and use subscript 6, your subscript is said to be out of bounds.
answer
True
question
You can easily merge files even if each file contains a different record layout.
answer
False
question
The most popular computer coding schemes include ASCII, Numeric, and EBCDIC.
answer
False
question
When methods must share data, you can pass the data into and return the data out of methods.
answer
True
question
No object is necessary with a static method.
answer
true
question
In object-oriented terminology, "default constructor" means a constructor with a single standard parameter.
answer
False
question
In object-oriented languages, the procedural modules that depend on user-initiated events are often called applets.
answer
False
question
The NOT operator is a unary operator, meaning it takes only one operand.
answer
true
question
Repetition and sequence are alternate names for a loop structure.
answer
False
question
Arrays cannot be used if you need to search for a range of values.
answer
False
question
Every high-level computer programming language contains a while statement.
answer
true
question
Object-oriented programmers usually specify that their data fields will have private access.
answer
true
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
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
In addition to their attributes, classes have methods associated with them, and every object instantiated from a given class possesses different methods.
answer
false
question
By using standard component classes, programmers are assured that the GUI components in their programs have the same look and feel as those in other programs.
answer
True
question
Computer users can expect to see a standard interface in the GUI programs they use.
answer
true
question
It is the programmer's responsibility to initialize all variables that must start with a specific value.
answer
True
question
The for loop is a good tool when working with arrays because you frequently need to process every element of an array from beginning to end.
answer
True
question
A(n) ____ consists of a label placed beside a small square.
answer
Check box
question
Making programs easier to use for people with physical limitations is known as enhancing ____.
answer
accessiblity
question
A ____ is a rectangular area into which the user can type text.
answer
text box
question
With a(n) ____ program, a user can continue to click buttons while your program is reading a data file.
answer
multithreaded
question
A ____ is one of the tiny dots of light that form a grid on your screen.
answer
pixel
question
A ____ is a rectangular object you can click; when you do, its appearance usually changes to look pressed.
answer
button
question
GUI programmers sometimes refer to screen space as ____
answer
real estate
question
When you use a menu bar, it is at the top of the screen in most GUI programs, and the first menu item is almost always ____.
answer
File
question
You should make sure that unavailable screen options are either dimmed (also called ____) or removed.
answer
grayed
question
A ____ represents a picture or sketch of a screen the user will see when running a program.
answer
wireframe
question
Performing an operation on an icon causes a(n) ____.
answer
event
question
In object-oriented languages, the procedural modules that depend on user-initiated events are often called ____.
answer
scripts
question
With most OOP languages, you must ____ components, or sign them up so that they can react to events initiated by other components.
answer
register
question
Within an event-driven program, a component from which an event is generated is the ____.
answer
source of the event
question
GUI components are excellent examples of the best principles of object-oriented programming; they represent objects with attributes and methods that operate like ____.
answer
black boxes
question
A GUI picture album has a picture or sketch of a screen the user will see when running a program.
answer
False
question
In an event-driven program, you design the screens, define the objects, and define how the screens will connect.
answer
true
question
GUI programs are frequently called action-controlled because actions occur in response to user-initiated events such as clicking a mouse button.
answer
False
question
When you program in a language that uses GUI components, you need to create them from scratch.
answer
False
question
Many object-oriented languages offer built-in classes that contain methods you can use to draw geometric figures.
answer
True
question
The entire list of parent classes from which a child class is derived constitutes the ____ of the subclass.
answer
ancestors
question
Classes that depend on field names from parent classes are said to be ____ because they are prone to errors.
answer
fragile
question
Object-oriented programs employ a more specific group of techniques for handling errors called ____.
answer
exception handling
question
When a data field within a class is ____, no outside class can use it-including a child class.
answer
private
question
In some programming languages, such as C#, Visual Basic, and Java, every class you create is a child of one ultimate base class, often called the ____ class.
answer
object
question
A method's name and a list of argument types together are its ____.
answer
signature
question
Code that has already been tested and used in a variety of situations is said to be ____.
answer
reliable
question
Programmers sometimes refer to a situation in which nothing goes wrong as the ____ case.
answer
sunny day
question
In object-oriented terminology, the generic name used for errors is ____.
answer
exceptions
question
A derived class always ____ case or instance of the more general base class.
answer
is a
question
____ are stored collections of classes that serve related purposes
answer
Libraries
question
In several languages, the visual development environment is known by the acronym ____.
answer
IDE
question
A(n) ____ in a class diagram indicates public access.
answer
plus sign
question
If an exception is thrown, it is passed to a block of code that can ____, which means to receive it in a block that can handle the problem
answer
catch the exception
question
When you purchase or download a(n) ____ for an object-oriented programming language, it comes packaged with many predefined, built-in classes
answer
compiler
question
An abstract class is one from which you can create any concrete objects and from which you can inherit.
answer
False
question
Any constructor you write must have the same name as the class it constructs, and it cannot have a return type.
answer
True
question
In OOP languages, a default constructor is created automatically by the compiler for every class you write.
answer
False
question
When methods have ____, other programs and methods may use the methods to get access to the private data.
answer
public access
question
____ methods are methods that exist to be used with an object created from a class.
answer
nonstatic
question
A ____ method is also known as a help method.
answer
work
question
In older object-oriented programming languages, simple numbers and characters are said to be ____ data types
answer
Primitive
question
In most programming languages, you use the word ____ when you want to declare a static class member.
answer
static
question
The purpose of a(n) ____ is to return a value from the class to a client.
answer
get method
question
The term ____ implies that the type's data is private and can be accessed only through methods.
answer
abstract data type
question
A(n) ____ is the adjective that defines the type of access (public or private) outside classes will have to the attribute or method.
answer
access specifier
question
____ methods are those for which no object needs to exist.
answer
static
question
____ are the characteristics of an object.
answer
attributes
question
The process of combining all of an object's attributes and methods into a single package is ____.
answer
encapsulation
question
When you think in an object-oriented manner, every object is a member of a more general ____.
answer
class
question
Instance variables are often called ____ to help distinguish them from other variables you might use.
answer
fields
question
The concept of a class is useful because of its ____.
answer
resuability
question
Object-oriented programmers also use the term ____ when describing inheritance.
answer
is-a
question
Methods in object-oriented programs use sequence, selection, and looping structures and make use of arrays.
answer
true
question
Methods in a class are static instance methods by default.
answer
false
question
Within any object-oriented program, you continuously make requests to an object's methods, often including arguments as part of those requests.
answer
true
question
A method that calls itself is a ____.
answer
recursive method
question
A method's name and parameter list constitute the method's ____.
answer
signature
question
A calling method sends a(n) ____ to a called method.
answer
argument
question
Programmers use the term ____ to describe any extra time and resources required by an operation.
answer
overhead
question
When a copy of a variable is sent to a method, it is passed by ____.
answer
value
question
You can think of the ____ in a method declaration as a funnel into the method.
answer
parentheses
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 called method accepts the value of an argument passed to it as its ____.
answer
parameter
question
The method name and parameter list constitute the ___
answer
signature
question
Each time a method executes, any parameter variables listed in the method header are ____.
answer
redeclared
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
When a data item is known to all of a program's modules, it is a ____data item.
answer
global
question
____ provide an overview of input to the method, the processing steps that must occur, and the result.
answer
IPO charts
question
____ refers to how the internal statements of a method serve to accomplish the method's purpose
answer
Cohesion
question
____ occurs when methods do not depend on others.
answer
Loose coupling
question
A method's return type is part of its signature.
answer
False
question
Methods with identical names that have identical parameter lists but different return types are ambiguous.
answer
True
question
A two-dimensional array contains two dimensions: ____.
answer
height and width
question
When you learn a method like sorting, programmers say you are learning a(n) ____.
answer
algorithm
question
In a ____, items in a list are compared with each other in pairs.
answer
bubble sort
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
To correctly swap two values, you create a(n) ____ variable to hold one of the values.
answer
temporary
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
When mathematicians use a two-dimensional array, they often call it a ____ or a table.
answer
matrix
question
The ____ is often used as a statistic in many cases because it represents a more typical case.
answer
median
question
The ____ is skewed by a few very high or low values.
answer
Mean
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
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
Each element in a two-dimensional array requires ____ subscript(s) to reference it.
answer
two
question
When you store data records, they exist in ____.
answer
some type of order
question
When you use an index, you can store records on a ____ storage device.
answer
random-access
question
A record's ____ field is the field whose contents make the record unique among all records in a file.
answer
key
question
It is relatively easy for people to keep track of arrays with more than three dimensions.
answer
False
question
Some programming languages allow multidimensional arrays
answer
true
question
You can make additional improvements to a bubble sort to reduce unnecessary comparisons.
answer
True
question
The saved version of a master file is the ____ file; the updated version is the child file.
answer
parent
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
When the records in a file are sorted in order from lowest to highest values, the records are in ____ order.
answer
ascending
question
A ____ is a copy that is kept in case values need to be restored to their original state.
answer
backup file
question
____ applications require that a record be accessed immediately while a client is waiting.
answer
Real-time
question
The combination of the disk drive plus the complete hierarchy of directories in which a file resides is its ____.
answer
path
question
Characters are made up of smaller elements called ____.
answer
bits
question
Files exist on ____ storage devices, such as hard disks, DVDs, USB drives, and reels of magnetic tape.
answer
permanent
question
When you copy data from a file on a storage device into RAM, you are ____ from the file.
answer
reading
question
In most programming languages, before an application can use a data file, it must ____.
answer
open the file
question
Directories and ____ are organization units on storage devices
answer
folder
question
A ____ is a temporary detour in the logic of a program.
answer
control break
question
____ is processing that involves performing the same tasks with many records, one after the other.
answer
batch processing
question
When you ____ a file, it is no longer available to your application.
answer
close
question
The keyboard and printer are the default input and output devices.
answer
false
question
Files in which records must be accessed immediately are sometimes called instant access files.
answer
true
question
Programmers usually use the word "write" to mean "produce hard copy output."
answer
False
question
Providing array values is sometimes called ____.
answer
populating the array
question
All array elements have the same group ____.
answer
name
question
Which statement is true of arrays?
answer
Only whole numbers can be used as array subscripts.
question
When you search through a list from one end to the other, you are performing a ____.
answer
linear search
question
Besides making your code easier to modify, using a ____ makes the code easier to understand.
answer
named constant
question
If you declare a variable to be Boolean, you can set its value to ____.
answer
true or false
question
A(n) ____ is another name for a subscript.
answer
index
question
Every array has a(n) ____ size.
answer
finite
question
In every programming language, when you access data stored in an array, you must use a ____ containing a value that accesses memory occupied by the array.
answer
subscript
question
The number of elements in an array is called the ____ of the array.
answer
size
question
Array elements all have the same ____ in common.
answer
data type
question
Parallel arrays are most useful when value pairs have a(n) ____ relationship.
answer
indirect
question
One advantage to using a named constant is that the statement becomes ____.
answer
self-documenting
question
A ____ search starts looking in the middle of a sorted list, and then determines whether it should continue higher or lower.
answer
binary
question
To search an array for a(n) ____ match, you can store either the highest or lowest valueof each range for comparison
answer
range
question
Many newer programming languages such as C++, Java, and C# use subscript 1 to access the first element of the array.
answer
False
question
You use subscripts 1 through 10 to access the elements in a ten element array.
answer
False
question
Declaring a named constant makes code easier to modify and understand.
answer
True
question
Loops are frequently used to ____; that is, to make sure it is meaningful and useful.
answer
validate data
question
A(n) ____ is any numeric variable you use to count the number of times an event has occurred.
answer
counter