Shared Flashcard Set

Details

CISC 192 Final Ch 9,10,13,14,15,16
Back of the Book Questions
188
Computer Science
Undergraduate 2
10/25/2012

Additional Computer Science Flashcards

 


 

Cards

Term
9.13 Each byte in memory is assigned a unique ______.
Definition
address
Term
9.14 The ______ operator can be used to determine a variable's address.
Definition
ampersand &
Term
9.15 _______ variables are designed to hold addresses.
Definition
pointers.
Term
9.16 The _______ operator can be used to work with the variable a pointer points to.
Definition
indirection *
Term
9.17 Array names can be used as ______, and vice versa.
Definition
pointers.
Term
9.18 Creating variables while a program is running is called.
Definition
Dynamic Memory Allocation
Term
9.19 The _____ operator is used to dynamically allocate memory.
Definition
new
Term
9.20 Under older compilers, if the new operator cannot allocate the amount of memory requested, it returns _____.
Definition
zero/null
Term
9.21 A pointer that contains the address 0 is called a(n) ____ pointer.
Definition
null
Term
9.22 When a program is finished with a chunk of dynamically allocated memory, it should free it with the _____ operator.
Definition
delete
Term
9.23 You should only use pointers with delete that were previously used with _____.
Definition
new
Term
9.32 The indirection * is used to get the address of a variable.
Definition
0
Term
9.33 The pointer variables are designed to hold addresses.
Definition
1
Term
9.34 The & symbol is called the indirection operator.
Definition
0
Term
9.35 The & operator dereferences a pointer.
Definition
0
Term
9.36 When the indirection operator is used with a pointer variable, you are actually working with the value the pointer is pointing to.
Definition
1
Term
9.37 Array names cannor be dereferenced with the indirection operator.
Definition
0
Term
9.38 When you add a value to a pointer, you are actually adding that number timesthe size of the data type referenced by the pointer.
Definition
1
Term
9.39 The address operator is not needed to assign an address to a pointer.
Definition
1
Term
9.40 You cannot change the addres that an array name points to.
Definition
0
Term
9.41 Any mathethimaticals operation, , including multiplication and division, may be performed on a pointer.
Definition
0
Term
9.42 Pointers may be compary using the relational operators.
Definition
1
Term
9.43 When used as function parameters, reference variables are much easier to work with that pointer.s
Definition
1
Term
9.44 The new operator dynamically alloates the memonry.
Definition
1
Term
9.45 A pointervariable that has not been initialized is called a numm pointer.
Definition
0
Term
9.46 The address 0 is generally considered unsuable.
Definition
1
Term
9.47 In using a pointer with the delete operator, it is not necessary for the pointer ta have neen proviously used wth the new operator.
Definition
0
Term
The _______ function returns true if the character argument is uppercase.
Definition
isupper
Term
The _______ function returns true if the character argument is a letter of the alphabet.
Definition
isalpha
Term
The _______ function returns true if the character argument is a digit.
Definition
isdigit
Term
The _______ function returns true if the character argument is a whitespace character.
Definition
isspace
Term
The ______ function returns the uppercase equivalent of its character argument.
Definition
toupper
Term
The _______ function returns the lowercase equivalent of its character argument.
Definition
tolower
Term
The ________ file must be included in a program that uses character testing functions.
Definition
cctype
Term
The _______ function returns the length of a string.
Definition
strlen
Term
To _______ two strings means to append one string to the other.
Definition
concatenate
Term
The ________ function concatenates two strings.
Definition
strcat
Term
The ________ function copies one string to another.
Definition
strcopy
Term
The ________ function searches for a string inside of another one.
Definition
strstr
Term
The _______ function compares two strings.
Definition
strcmp
Term
The ________ function copies, at most, n number of characters from one string to another.
Definition
strncopy
Term
The _______ function returns the value of a string converted to an integer.
Definition
atoi
Term
The _______ function returns the value of a string converted to a long integer.
Definition
atol
Term
The _______ function returns the value of a string converted to a float.
Definition
atof
Term
The _______ function converts an integer to a string.
Definition
itoa
Term
Character testing functions such as isupper, accept strings as arguments and test each character in the string. (T/F)
Definition
FALSE
Term
If toupper's argument is already uppercase, it is returned as is, with no changes. (T/F)
Definition
TRUE
Term
If tolowers's argument is already lowercase, it will be inadvertently converted to uppercase. (T/F)
Definition
FALSE
Term
The strlen function returns the size of the array containing a string.
Definition
false, length not size
Term
If the starting address of a C-string is passed into a pointer parameter, it can be assumed that all the characters, from that address up to the byte that holds the null terminator, are part of the string. (T/F)
Definition
TRUE
Term
C-string handling functions accept as arguments pointers to strings (array names or pointer variables), or literal strings. (T/F)
Definition
TRUE
Term
The strcat function checks to make sure the first string is large enough to hold both strings before performing the concatenation. (T/F)
Definition
False, no bound checking in C++
Term
The strcpy function will overwrite the contents of its first string argument. (T/F)
Definition
TRUE
Term
The strcpy function performs no bounds checking on the first argument. (T/F)
Definition
TRUE
Term
There is no difference between "847" and 847. (T/F)
Definition
FALSE
Term
13.17. The two common programming methods in practice today are _________ and _________.
Definition
Procedural and Object Orientated
Term
13.18. _________ programming is centered around functions or procedures.
Definition
Procedural
Term
13.19. _________ programming is centered around objects.
Definition
Object Orientated
Term
13.20. _________ is an object s ability to contain and manipulate its own data.
Definition
Incapsulation
Term
13.21. In C++ the _________ is the construct primarily used to create objects.
Definition
Class
Term
13.22. A class is very similar to a(n) _________.
Definition
Structure
Term
13.23. A(n) _________ is a key word inside a class declaration that establishes a member's accessibility.
Definition
Access Specifier
Term
13.24. The default access specification of class members is _________.
Definition
Private
Term
13.25. The default access specification of a struct in C++ is _________.
Definition
Public
Term
13.26. Defining a class object is often called the _________ of a class.
Definition
Instantiation
Term
13.27. Members of a class object may be accessed through a pointer to the object by using the _________ operator.
Definition
The Arrow is the Pointer Operator -->
Term
13.28. If you were writing the declaration of a class named Canine, what would you name the file it was stored in? _________
Definition
Canine.H
Term
13.29. If you were writing the external definitions of the Canine class s member functions, you would save them in a file named _________.
Definition
Canine.cpp
Term
13.30. When a member function s body is written inside a class declaration, the function is _________.
Definition
inline
Term
13.31. A(n) _________ is automatically called when an object is created.
Definition
Constructor
Term
13.32. A(n) _________ is a member function with the same name as the class.
Definition
Constructor
Term
13.33. _________ are useful for performing initialization or setup routines in a class object.
Definition
Constructors
Term
13.34. Constructors cannot have a(n) _________ type.
Definition
Return Type
Term
13.35. A(n) _________ constructor is one that requires no arguments.
Definition
Default
Term
13.36. A(n) _________ is a member function that is automatically called when an object is destroyed.
Definition
Destructor
Term
13.37. A destructor has the same name as the class, but is preceded by a(n) _________ character.
Definition
tilde ~
Term
13.38. Like constructors, destructors cannot have a(n) _________ type.
Definition
return
Term
13.39. A constructor whose arguments all have default values is a(n) _________ constructor.
Definition
default
Term
13.40. A class may have more than one constructor, as long as each has a different _________.
Definition
parameter list
Term
13.41. A class may only have one default _________ and one _________.
Definition
constructor and destructor
Term
13.42. A(n) _________ may be used to pass arguments to the constructors of elements in an object array.
Definition
initialization
Term
13.51. T F Private members must be declared before public members.
Definition
F
Term
13.52. T F Class members are private by default.
Definition
T
Term
13.53. T F Members of a struct are private by default.
Definition
F
Term
13.54. T F Classes and structures in C++ are very similar.
Definition
T
Term
13.55. T F All private members of a class must be declared together.
Definition
F
Term
13.56. T F All public members of a class must be declared together.
Definition
F
Term
13.57. T F It is legal to de ne a pointer to a class object.
Definition
T
Term
13.58. T F You can use the new operator to dynamically allocate an instance of a class.
Definition
T
Term
13.59. T F A private member function may be called from a statement outside the class, as long as the statement is in the same program as the class declaration.
Definition
F
Term
13.60. T F Constructors do not have to have the same name as the class.
Definition
F
Term
13.61. T F Constructors may not have a return type.
Definition
T
Term
13.62. T F Constructors cannot take arguments.
Definition
F
Term
13.63. T F Destructors cannot take arguments.
Definition
T
Term
13.64. T F Destructors may return a value.
Definition
F
Term
13.65. T F Constructors may have default arguments.
Definition
T
Term
13.66. T F Member functions may be overloaded.
Definition
T
Term
13.67. T F Constructors may not be overloaded.
Definition
F
Term
13.68. T F A class may not have a constructor with no parameter list, and a constructor whose arguments all have default values.
Definition
T
Term
13.69. T F A class may only have one destructor.
Definition
T
Term
13.70. T F When an array of objects is de ned, the constructor is only called for the rst element.
Definition
F
Term
13.71. T F To nd the classes needed for an object-oriented application, you identify all of the verbs in a description of the problem domain.
Definition
F
Term
13.72. T F A class s responsibilities are the things the class is responsible for knowing, and actions the class must perform.
Definition
T
Term
If a member variable is declared ________, all objects of that class have access to the same variable.
Definition
Static
Term
Static member variables are defined ________ the class.
Definition
Outside
Term
A(n) ________ member function cannot access any nonstatic member variables in its own class.
Definition
Static
Term
A static member function may be called _______ any instances of its class are defined.
Definition
Before
Term
A(n) ________ function is not a member of the class, but has access to the private members of the class.
Definition
Friend
Term
A(n) _______ tell the compiler that a specific class will be declared later in the function.
Definition
Forward declaration
Term
________ is the default behavior when an object is assigned the value of another object of the same class.
Definition
Memberwise assignment
Term
A(n) ________ is a special constructor, called whenever a new object is initialized with another object's data.
Definition
Copy Constructor
Term
_______ is a special built in pointer that is automatically passed as a hidden argument to all nonstatic member functions.
Definition
This
Term
An operator may be _______ to work with a specific class.
Definition
Overloaded
Term
When overloading the ________ operator, its function must have a dummy parameter.
Definition
Postfix increment (or decrement)
Term
Making an instance of one class a member of another class is called ________.
Definition
Aggregation
Term
Object aggregation is useful for creating a(n) ________ relationship between two classes.
Definition
Has a
Term
Static variables cannot be accessed by nonstatic member functions. t/f
Definition
TRUE
Term
Static member variables are defined outside their class declaration. t/f
Definition
TRUE
Term
A static member function may refer to nonstatic member variables of the same class, but only after an instance of the class has been defined. t/f
Definition
FALSE
Term
When a function is declared a friend by a class, it becomes a member of the class. t/f
Definition
FALSE
Term
A friend has access to the private members of the class declaring it a friend. t/f
Definition
TRUE
Term
an entire class may be declared a friend of another class. t/f
Definition
TRUE
Term
In order for a function or a class to become a friend of another class, it must be declared as such by the class granting it access. t/f
Definition
TRUE
Term
If a class has a pointer as a member, it's a good idea to also have a copy constructor. t/f
Definition
TRUE
Term
You cannot use the = operator to assign one object's values to another object, unless you overload the operator. t/f
Definition
FALSE
Term
If a class doesn't have a copy constructor, the compiler generates a default copy constructor for it. t/f
Definition
TRUE
Term
If a class has a copy constructor, and an object of that class is passed by value into a function, the function's parameter will not call its copy constructor. t/f
Definition
FALSE
Term
The "this" pointer is passed to static member functions. t/f
Definition
FALSE
Term
All functions that overload unary operators must have a dummy parameter. t/f
Definition
FALSE
Term
For an object to perform automatic type conversion, an operator function must be written. t/f
Definition
TRUE
Term
It is possible to have an instance of one class as a member of another class. t/f
Definition
TRUE
Term
19. A derived class inherits the __________ of its base class.
Definition
members
Term
20. When both a base class and a derived class have constructors, the base class s constructor is called __________ (first/last).
Definition
first
Term
21. When both a base class and a derived class have destructors, the base class s constructor is called __________ (first/last).
Definition
last
Term
22. An overridden base class function may be called by a function in a derived class by using the __________ operator.
Definition
scope resolution operator
Term
23. When a derived class redefines a function in a base class, which version of the function do objects that are defined of the base class call? __________
Definition
base class version
Term
24. A(n) __________ member function in a base class expects to be overridden in a derived class.
Definition
virtual
Term
25. __________ binding is when the compiler binds member function calls at compile time.
Definition
static
Term
26. __________ binding is when a function call is bound at runtime.
Definition
dynamic
Term
27. __________ is when member functions in a class hierarchy behave differently, depending upon which object performs the call.
Definition
polymorphism
Term
28. When a pointer to a base class is made to point to a derived class, the pointer ignores any __________ the derived class performs, unless the function is __________.
Definition
overriding / virtual
Term
29. A(n) __________ class cannot be instantiated.
Definition
abstract base class
Term
30. A(n) __________ function has no body, or definition, in the class in which it is declared.
Definition
pure
Term
31. A(n) __________ of inheritance is where one class is derived from a second class, which in turn is derived from a third class.
Definition
chain
Term
32. __________ is where a derived class has two or more base classes.
Definition
ultiple inheritance
Term
33. In multiple inheritance, the derived class should always __________ a function that has the same name in more than one base class.
Definition
override
Term
38. T F The base class s access speci cation affects the way base class member functions may access base class member variables.
Definition
F
Term
39. T F The base class s access speci cation affects the way the derived class inherits members of the base class.
Definition
T
Term
40. T F Private members of a private base class become inaccessible to the derived class.
Definition
T
Term
41. T F Public members of a private base class become private members of the derived class.
Definition
T
Term
42. T F Protected members of a private base class become public members of the derived class.
Definition
F
Term
43. T F Public members of a protected base class become private members of the derived class.
Definition
F
Term
44. T F Private members of a protected base class become inaccessible to the derived class.
Definition
T
Term
45. T F Protected members of a public base class become public members of the derived class.
Definition
F
Term
46. T F The base class constructor is called after the derived class constructor.
Definition
F
Term
47. T F The base class destructor is called after the derived class destructor.
Definition
T
Term
48. T F It isn t possible for a base class to have more than one constructor.
Definition
F
Term
49. T F Arguments are passed to the base class constructor by the derived class constructor.
Definition
T
Term
50. T F A member function of a derived class may not have the same name as a member function of the base class.
Definition
F
Term
51. T F Pointers to a base class may be assigned the address of a derived class object.
Definition
T
Term
52. T F A base class may not be derived from another class.
Definition
F
Term
The line containing a throw statement is known as the ________.
Definition
Throw Point
Term
The ________ block contains code that directly or indirectly might cause an exception to be thrown.
Definition
Try
Term
The ______ block handles an exception.
Definition
Catch
Term
When writing function or class templates, you use a(n) ________ to specify the generic data type.
Definition
Type Parameter
Term
The beginning of a template is marked by a(n) ______.
Definition
Template Prefix
Term
When defining objects of class templates, the ________ you wish to pass into the type parameter must be specified.
Definition
Data Type
Term
A(n) ______ template works with a specific data type.
Definition
Specialized
Term
A(n) ________ container organizes data in a sequential fashion similar to an array.
Definition
Sequence
Term
A(n) _______ container uses keys to rapidly access elements.
Definition
associative
Term
_______ are pointer like objects used to access data stored in a container.
Definition
Iterators
Term
The ________ exception is thrown when the new operator fails to allocate the requested amount of memory.
Definition
bad_alloc
Term
There can only be one catch block in a program. t/f
Definition
FALSE
Term
When an exception is thrown, but not caught, the program ignores the error. t/f
Definition
FALSE
Term
Data may be passed with an exception by storing it in members of an exception class. t/f
Definition
TRUE
Term
Once an exception has been thrown, it is not possible for the program to jump back to the throw point.
Definition
TRUE
Term
All type parameters defined in a function template must appear at least once in the function parameter list. t/f
Definition
TRUE
Term
The compiler creates an instance of a function template in memory as soon as it encounters the template. t/f
Definition
FALSE
Term
A class object passed to a function template must overload any operators used on the class object by the template. t/f
Definition
TRUE
Term
Only one generic type may be used with a template. t/f
Definition
FALSE
Term
In the function template definition, it is not necessary to use each type parameter declared in the template prefix. t/f
Definition
FALSE
Term
It is possible to overload two function templates. t/f
Definition
TRUE
Term
It is possible to overload a function template and an ordinary (nontemplate) function. t/f
Definition
TRUE
Term
A class template may not be derived from another class template. t/f
Definition
FALSE
Term
A class template may not be used as a base class. t/f
Definition
FALSE
Term
Specialized templates work with a specific data type. t/f
Definition
TRUE
Term
When defining an iterator from the STL, the compiler automatically creates the right kind, depending upon the container it is to be used with. t/f
Definition
TRUE
Term
STL algorithms are implemented as function templates. t/f
Definition
TRUE
Supporting users have an ad free experience!