Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
70 Cards in this Set
- Front
- Back
The advantage of a linear search is its __________. a) complexity b) efficiency c) simplicity d) speed |
c) simplicity
|
|
A(n) ________ search is more efficient than a(n) ________ search. a) character, string b) integer, double c) binary, linear d) linear, binary |
c) binary, linear |
|
A binary search begins with the _________ element of an array. a) first b) last c) largest d) middle |
d) middle |
|
The bubble sort is an easy way to arrange data into ascending order, but it cannot arrange data into descending order. a) True b) False |
b) False |
|
Before you can perform a selection sort, the data must be stored in ascending order. a) True b) False |
b) False |
|
The number of comparisons made by a binary search is expressed in powers of two. a) True b) False |
a) True |
|
The _________ sort usually performs fewer exchanges than the ________ sort. a) bubble, selection b) binary, linear c) selection, bubble d) ANSI, ASCII |
c) selection, bubble |
|
A(n) ________ search uses a loop to sequentially step through an array. a) binary b) unary c) linear d) relative |
c) linear |
|
When an array is sorted from highest to lowest, it is said to be in _____ order. a) reverse b) forward c) ascending d) descending |
d) descending |
|
Using a binary search, you are more likely to find an item than if you use a linear search. a) True b) False |
b) False |
|
Each byte of memory is assigned a unique address. True False |
True |
|
The * operator is used to get the address of a variable. True False |
False |
|
The pointer variable are designed to hold addresses. True False |
True |
|
The & symbol is called the indirection operator. True False |
False |
|
The & operator derefences a pointer. True False |
False |
|
When the indirection operator is used with a pointer variable, you are actually working with the value the pointer is pointing to. True False |
True |
|
Array names cannot be deferenced with the indirection operator. True False |
False |
|
When you add a value to a pointer, you are actually adding that number times the size of the data type referenced by the pointer. True False |
True |
|
The address operator is not needed when assigning an array's address to a pointer. True False |
True |
|
You cannot change the address that an array name points to. True False |
True |
|
There is no difference between "847" and 847. True False |
False |
|
The strcpy function performs no bounds checking on the first argument. True False |
True |
|
The strcpy function will overwrite the contents of its first string argument. True False |
True |
|
The strcat function checks to make sure the first string is large enough to hold both strings before performing the concatenation. True False |
False |
|
String handling functions accept as arguments pointers to strings (array names or pointer variables), or literal strings. True False |
True |
|
If the starting address of a 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. True False |
True |
|
The strlen function returns the size of the array containing a string. True False |
False |
|
If tolowers argument is already lowercase, it will be inadvertently converted to uppercase. True False |
False |
|
If toupper's argument is already uppercase, it is returned as is, with no changes. True False |
True |
|
Character testing functions, such as isupper, accept strings as arguments and test each character in the string. True False |
False |
|
Before a structure variable can be created, the structure must be ____________. |
Declared |
|
The _________ is the name of the structure type. |
tag |
|
The variables declared inside a structure declaration are called ____________. |
members |
|
A(n) _______ is required after the closing brace of a structure declaration. |
semicolon |
|
in the definition of a structure variable, the __________ is placed before the variable name, just like the data type of a regular variable is placed before its name. |
tag |
|
When a structure is passed _________to a function, its members are not copied. a) by reference b) by value c) None of these |
a) by reference |
|
Data types that are created by the programmer are known as: a) variables b) abstract data types c) functions d) parameters |
b) abstract data types |
|
A structure _____________ contain members of the same data type. a) cannot b) can c) shouldn't d) None of these |
b) can |
|
A declaration for an enumerated type begins with this key word. a) enumerated b) enum_type c) enum d) ENUM |
c) enum |
|
Look at the following declaration. enum Tree { OAK, MAPLE, PINE };In memory, what value will the MAPLE enumerator be stored as? a) "MAPLE" b) 2 c) 'M' d) 1 |
d) 1 |
|
When you store data in a variable, it is automatically saved in a file. True False |
False |
|
The ios::out flag causes the file's existing contents to be deleted if the file already exists. True False |
True |
|
File output may be formatted the same way as console screen output. True False |
True |
|
When data is read from a file, it is automatically stored in a variable. True False |
False |
|
When passing a file stream object to a function, you should always pass it by reference. True False |
True |
|
This data type can be used to create files and write information to them but cannot be used to read information from them. a) ofstream b) ifstream c) afstream d) outstream |
a) ofstream |
|
What is true about the following statement?out.open("values.dat", ios::app); a) If the file already exists, its contents are preserved and all output is written to the end of the file. b) If the file exists, it should be replaced with a new copy of values.dat c) If the file exists, it can be opened but not modified d) None of these. |
a) If the file already exists, its contents are preserved and all output is written to the end of the file. |
|
Which of the following statements opens the file info.txt for both input and output? a) dataFile.open("info.txt", ios::in && ios::out); b) dataFile.open("info.txt", ios::in , ios::out); c) dataFile.open("info.txt", input || output);d) dataFile.open("info.txt", ios::in | ios::out); |
d) dataFile.open("info.txt", ios::in | ios::out); |
|
Outside of a C++ program, a file is identified by its _________. Inside a C++ program, a file is identified by a ____________. a) file number, file name b) file name, file number c) name, address d) name, file stream object |
d) name, file stream object |
|
Closing a file causes any unsaved information still held in the file buffer to be a) saved to the file b) deleted c) retained in the buffer for safekeeping. d) duplicated |
a) saved to the file |
|
Private members must be declared before public members. True False |
False |
|
Class members are private by default. True False |
True |
|
Members of a struct are private by default. True False |
False |
|
Classes and structures in C++ are very similar.True False |
True |
|
All private members of a class must be declared together. True False |
False |
|
All public members of a class must be declared together. True False |
False |
|
It is legal to define a pointer to a class object.True False |
True |
|
You can use the new operator to dynamically allocate an instance of a class. True False |
True |
|
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. True False |
False |
|
Constructors do not have to have the same name as the class. True False |
False |
|
Objects are created from abstract data types that encapsulate _______ and _______ together. a) numbers, characters b) data, functions c) addresses, pointers d) integers, floats |
b) data, functions |
|
In OOP terminology, an object's member variables are often called its _________, and its member functions are sometimes referred to as its behaviors, or ____________. a) values, morals b) data, activities c) attributes, activities d) attributes, methods |
d) attributes, methods |
|
Examples of access specifiers are the keywords: a) near and far b) opened and closed c) private and public d) table and row |
c) private and public |
|
Class declarations are usually stored here. a) On separate disk volumes b) In their own header files c) In .cpp files, along with function definitions d) Under pseudonyms |
b) In their own header files |
|
A ___________ is a member function that is automatically called when a class object is ___________. a) destructor, created b) constructor, created c) static function, deallocated d) utility function, declared |
b) constructor, created |
|
When a constructor function accepts no arguments, or does not have to accept arguments because of default arguments, it is called a(n): a) empty constructor b) default constructor c) stand-alone function d) arbitrator function |
b) default constructor |
|
This type of member function may be called from a statement outside the class. a) public b) private c) undeclared d) global |
a) public |
|
A class is a(n) _____________ that is defined by the programmer. a) data type b) function c) method d) attribute |
a) data type |
|
Assuming that Rectangle is a class name, the statement Rectangle *BoxPtr; a) declares an object of class Rectangle b) assigns the value of *BoxPtr to the object Rectangle c) defines a Rectangle pointer variable called BoxPtr d) is illegal in C++ |
c) defines a Rectangle pointer variable called BoxPtr |
|
When you dereference an object pointer, use the a) -> operator b) <> operator c) dot operator d) & operator |
a) -> operator |