COP1000 Study Guide For Final

24 July 2022
4.7 (114 reviews)
83 test answers

Unlock all answers in this set

Unlock answers (79)
question
Within any object-oriented program, you continuously make requests to an object's methods, often including arguments as part of those requests. T or F?
answer
True
question
A parallel array is an array that stores another array in each element. T or F?
answer
False
question
Declaring a named constant makes code easier to modify and understand. T or F?
answer
True
question
Methods in object-oriented programs use sequence, selection, and looping structures and make use of arrays. T or F?
answer
True
question
Many newer programming languages such as C++, Java, and C# use subscript 1 to access the first element of the array. T or F?
answer
False
question
When you have a five element array and use subscript 6, your subscript is said to be out of bounds. T or F?
answer
True
question
You use subscripts 1 through 10 to access the elements in a ten element array. T or F?
answer
False
question
You can improve the efficiency of a program by leaving a loop as soon as a match is found in the array. T or F?
answer
True
question
The accessor method is another name for the set method. T or F?
answer
False
question
Many newer programming languages such as C++, Java, and C# use the square bracket notation for arrays. T or F?
answer
True
question
Object-oriented programmers usually specify that their data fields will have private access. T or F?
answer
True
question
Class diagrams consists of a rectangle divided into three sections. T or F?
answer
True
question
All methods require a this reference. T or F?
answer
False
question
Declaring a class does not create actual objects. T or F?
answer
True
question
Parallel arrays must contain the same data type. T or F?
answer
False
question
Arrays cannot be used if you need to search for a range of values. T or F?
answer
False
question
In addition to their attributes, classes have methods associated with them, and every object instantiated from a given class possesses different methods. T or F?
answer
False
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. T or F?
answer
True
question
Array elements all have the same ____ in common. a. pointer b. memory location c. value d. data type
answer
d. data type
question
The purpose of a(n) ____ is to return a value from the class to a client. a. get method b. set method c. pull method d. access method
answer
a. get method
question
One advantage to using a named constant is that the statement becomes ____. a. self-perpetuating b. self-documenting c. self-referencing d. self-mitigating
answer
b. self-documenting
question
To search an array for a(n) ____ match, you can store either the highest or lowest value of each range for comparison. a. flag b. index c. subscript d. range
answer
d. range
question
When methods have ____, other programs and methods may use the methods to get access to the private data. a. private access b. public access c. complete access d. all access
answer
b. public access
question
The true benefit of using an array lies in your ability to use a ____ as a subscript to the array. a. constant b. loop c. command d. variable
answer
d. variable
question
Object-oriented programmers sometimes say an object is one ____ of a class. a. enumeration b. instantiation c. member d. reference
answer
b. instantiation
question
Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[5]. You know that ____. --- a. numbers[1] is smaller than numbers[5] b. there are exactly four elements between those two elements c. numbers[5] is the last element in the array d. there are exactly three elements between those two elements
answer
d. there are exactly three elements between those two elements
question
A ____ relates parallel arrays. a. superscript b. key c. subscript d. postscript
answer
c. subscript
question
The purpose of ____ is to set or change the values of data fields defined within the class. a. get methods b. put methods c. make methods d. set methods
answer
d. set methods
question
A(n) ____ is another name for a subscript. a. pointer b. sequence c. index d. place holder
answer
c. index
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. a. superscript b. subscript c. key d. condition
answer
b. subscript
question
A(n) ____ is the adjective that defines the type of access (public or private) outside classes will have to the attribute or method. a. control specifier b. control modifier c. access specifier d. access controller
answer
c. access specifier
question
Every array has a(n) ____ size. a. infinite b. finite c. variable d. constant
answer
b. finite
question
The number of bytes in an array is always a multiple of the number of ____ in an array. a. subscripts b. elements c. iterators d. indexes
answer
b. elements
question
The number of elements in an array is called the ____ of the array. a. width b. size c. height d. depth
answer
b. size
question
A(n) ____ is a programmer-defined type, such as a class. a. inheritance b. numeric data type c. primitive data type d. abstract data type
answer
d. abstract data type
question
____ is a programming model that focuses on an application's components and data and methods the components use. a. Classical programming b. Functional programming c. Procedural programming d. Object-oriented programming
answer
d. Object-oriented programming -- not sure
question
The data components of a class that belong to every instantiated object are the class's ____. a. numeric variables b. string variables c. instance variables d. data variables
answer
c. instance variables
question
An array can be used to replace ____. a. records b. methods c. nested decisions d. loops
answer
c. nested decisions
question
Objects both in the real world and in object-oriented programming contain ____ and methods. a. behaviors b. attributes c. help d. primitive data types
answer
b. attributes
question
A ____ method is also known as a help method. a. work b. private c. public d. set
answer
a. work
question
When a subscript is not within the range of acceptable subscripts, it is said to be ____. a. a superscript b. flagged c. out of bounds d. indexed
answer
c. out of bounds
question
____ are the characteristics of an object. a. Instances b. Attributes c. Behaviors d. Methods
answer
b. Attributes
question
The concept of a class is useful because of its ____. a. reusability b. mapping to reality c. abstract nature d. portability
answer
a. reusability
question
Named ____ hold values that do not change during a program's execution. a. constants b. variables c. objects d. items
answer
a. constants
question
Besides making your code easier to modify, using a ____ makes the code easier to understand. a. standard constant b. named constant c. literal constant d. named variable
answer
b. named constant
question
All array elements have the same group ____. a. subscript b. name c. memory location d. value
answer
b. name
question
When you think in an object-oriented manner, every object is a member of a more general ____. a. class b. struct c. method d. collection
answer
a. class
question
Instance variables are often called ____ to help distinguish them from other variables you might use. a. rows b. records c. columns d. fields
answer
d. fields
question
Parallel arrays are most useful when value pairs have a(n) ____ relationship. a. direct b. indirect c. linked d. tiered
answer
b. indirect
question
A(n) ____ consists of a rectangle divided into three sections. a. class tree b. dependency diagram c. class diagram d. entity-relationship diagram
answer
c. class diagram
question
In all languages, subscript values must be sequential ____. a. characters b. fractions c. real numbers d. integers
answer
d. integers
question
A program contains an array that holds all the names of the days of the week. Which of the following is true? a. The highest subscript is 6. b. The highest subscript is 7. c. The lowest subscript is 1. d. The highest subscript is 12.
answer
a. The highest subscript is 6.
question
A(n) ____ is a program or class that instantiates objects of another prewritten class. a. instantiation b. method c. class client d. class definition
answer
c. class client
question
Methods that set values are called ____ methods. a. modifier b. mutator c. creator d. access
answer
b. mutator
question
Which statement is true of arrays? a. Only whole numbers can be used as array b. Only whole numbers can be stored in arrays. c. Arrays cause more work for the programmer, but allow faster program execution. d. Array elements cannot be reset after the array is declared.
answer
a. Only whole numbers can be used as array
question
A ____ is a set of program statements that lists the characteristics of each object and the methods each object can use. a. class interface b. class definition c. class reference d. class model
answer
b. class definition
question
In older object-oriented programming languages, simple numbers and characters are said to be ____ data types. a. primitive b. simple c. complex d. higher-order
answer
a. primitive
question
Providing array values is sometimes called ____. a. creating the array b. declaring the array c. accumulating the array d. populating the array
answer
d. populating the array
question
The process of combining all of an object's attributes and methods into a single package is ____. a. encapsulation b. inheritance c. information hiding d. data hiding
answer
a. encapsulation
question
An array is a(n) ____ of values in computer memory. a. list b. accumulation c. set d. record
answer
a. list
question
If you declare a variable to be Boolean, you can set its value to ____. a. any number b. true or false c. any integer d. 1 or -1
answer
b. true or false
question
62. Object-oriented programmers also use the term ____ when describing inheritance. a. has-a b. from-a c. is-a d. contains
answer
c. is-a
question
A ____ search starts looking in the middle of a sorted list, and then determines whether it should continue higher or lower. a. linear b. binary c. quadratic d. divided
answer
b. binary
question
Another important concept in object-oriented programming is ________, which is the process of acquiring the traits of one's predecessors.
answer
inheritance
question
A subscript, also called a(n) ____________________, is a number that indicates the position of a particular item within an array.
answer
index
question
All array elements have the same ____________________ name, but each individual element also has a unique subscript indicating how far away it is from the first element.
answer
group
question
Use a(n) ____________________ to indicate the position of a particular item within an array.
answer
subscript or index
question
A program or class that instantiates objects of another prewritten class is a ____________________ .
answer
class client
question
A(n) ____________________ is one instance of a class.
answer
object
question
When you think in an object-oriented manner, everything is a(n) ____________________.
answer
object
question
When working with arrays, you can use ____________________ in several ways: To hold the size of an array, as the array values, and as a subscript .
answer
constants
question
A(n) ____________________ is a variable set to indicate whether some event has occurred.
answer
flag
question
____________________ is the process of combining all of an object's attributes and methods into a single package.
answer
encapsulation
question
Describes a group or collection of objects with common attributes
answer
class
question
An instance of a class
answer
object
question
The characteristics that define an object as part of a class
answer
attributes
question
The data components of a class that belong to every instantiated object
answer
instance variables
question
The set of all the values or contents of a class object's instance variables
answer
state
question
A program or class that instantiates objects of another prewritten class
answer
class client
question
Simple numbers and characters
answer
primitive data types
question
The process of acquiring the traits of one's predecessors
answer
inheritance
question
The process of combining all of an object's attributes and methods into a single package
answer
encapsulation
question
The concept that other classes should not alter an object's attributes--only the methods of an object's own class should have that privilege
answer
information hiding