1/101
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
A one dimensional array data[4] has a base address 2222 and each element takes one location. What is the address of the fourth element?
2225
A record is declared as follows: The first letter in the first name is at location 1000, each letter takes one location, and an integer takes two locations. What is the beginning address of age?
1030
C++ does not have any built-in exceptions.
False
Client code can directly access the private members of the base class but derived code cannot.
False
Code that can cause an exception should be enclosed within a try clause.
True
Exception handlers are enclosed within a catch clause.
True
Exceptions must be handled within the function in which they occur.
False
In C++, if class X is a base class of class Y, then Y cannot directly access X's private data.
True
Inheritance is a language mechanism by which one class acquires data and operations of another class.
True
O(1) is called constant time.
True
O(N) is called log time.
False
O(N*N) is called quadratic time
True
O(N*N) is called quadratic time
False
The OOP term "instance variable" corresponds to the C++ term "class object."
False
The file containing the definitions of the member functions of class DateType is called the ______ file.
implementation
The following statement means that any subsequent use of GetData without qualification refers to myNames::GetData: using myNames::GetData.
True
The logical view of a data structure is associated with:
What?
The member variables and functions declared following the word "______" are accessible to the client program.
public
The members of a class are public by default.
False
Containment is a mechanism by which an internal data member of one class is defined to be an object of another class type.
True
In C++, a derived class's constructor is executed before the base class constructor is executed.
False
Derived class code can directly access the private members of the base class but client code cannot.
False
Reset and GetNextItem implement an iterator
True
using myNames::GetData is a using directive.
False
What is the order of adding 1 to each element in a one dimensional array of N integers?
O(N)
What is the order of adding 10.0 to each element in a one-dimensional array of N real numbers?
O(N)
When a class member function is a binary operation, how are the operands specified?
One operand is passed to the member function and the second is the class instance to which the function is applied.
When writing the code to define a member function, the name of _____ must precede the function name with the _____ operator in between.
the class, ::
using myNames::GetData is a using declaration.
True
using namespace myName is a using directive.
True
A program that includes the file containing a class declaration is called a ________ program of the class.
Client
A program that sets up the testing environment for a subprogram is called a:
test driver
All arrays in C++ are passed as ____________ parameters.
reference
An assertion that is always true is called a:
loop invariant
Arrange the following types of tests in chronological order: 1. integration, 2. regression, 3. acceptance, 4. unit
4, 1, 3, 2
Black-box testing is based on the types of the parameters.
False
Bottom-up testing requires drivers
False
A code segment compiles and prints either the value of count or "Count is equal to 10."
True
Clear-box testing is based on the types of the parameters.
False
Complete black-box testing is feasible
False
Minimum number of test cases needed to adequately test a function Triangle.
8
Software engineering vs software process:
Software process is the process of analyzing, designing, coding, testing, and maintaining software. Software engineering is a disciplined approach to designing and producing software efficiently and correctly.
Program verification
Are we building the product right?
program validation
Are we building the right product?
Type use example: aBird = Birds(aBird + 1)
type casting
Executing every branch at least once is feasible.
True
Function prototypes are:
Declarations
Order of execution of operators in C++:
NOT first, then relational operators, then other Boolean operators
Testing based on code coverage is called:
clear (white box) testing
Testing based on data coverage is called:
black-box testing
Ability of a program to recover following an error is called:
robustness
Assertion that states what is true after execution is known as:
postcondition
Assertion that states what is true before execution of a code segment is known as:
precondition
The programmer must always write some code before a test plan can be generated.
False
The separation of the logical properties of functions from their implementation is known as:
procedural abstraction
Top-down testing is always preferable to bottom-up testing.
False
Top-down testing requires drivers.
True
A code walk-through is a verification method that must be done by a team.
False
Regression testing is done after a program has been modified.
True
A code walk-through is a verification method done by the programmer.
True
An exception should be handled at a level that understands what the exception means.
True
An unhandled exception in C++ carries the penalty of program termination.
True
Black-box testing is based on the code being tested.
False
C++ provides no mechanisms to manage exceptions.
False
Clear-box testing is based on the code being tested.
True
Executing every path at least once is feasible.
False
Executing every statement at least once is feasible.
true
In object-oriented design, an operation on an object might be designed using structured (top-down) design.
True
What happens when a file with only 5 values is read with a loop expecting 6?
The code prints the first 5 values and crashes.
Goal of information hiding:
Controlling access to the details of a function
Role of count in a loop reading values:
At the beginning of each iteration, count contains the number of values read in
Value of count when loop exits (specific example):
4
What should go in the blank if storing values into int data[LIMIT]?
data[index]
Bottom-up testing is preferable when testing the implementation of an ADT.
True
Stream extraction operator
»
Stream insertion operator
«
A stream in C++ goes into the fail state when a read has been issued after the last value on a file has been read.
True
Operator evaluated first in expression (count && !flag)?
!
Constructor cannot be explicitly called by the client program.
True
A list is:
a variable-sized, user-defined structure; the mechanism for accessing the structure must be provided through functions
An array is fixed size, whereas a list is variable size.
True
An array is
a fixed-size structure; the mechanism for accessing the structure is built into C++
If you have a constructor, you do not need a MakeEmpty operation.
True
In a linked implementation of a list, you can have an iterator.
False
In an unsorted list, there is a semantic relationship between successive items in the list.
False
It is not possible to use a list without knowing how it is implemented.
False
The algorithm for deleting from an unsorted list has the last item replace the item being deleted.
True
The external pointer is considered to be one of the nodes of a linked list.
False
The next item in a linked list can always be found by accessing the next physical location in memory.
False
To prevent a compile-time error with ListNode and NodeType:
Either insert struct ListNode; typedef ListNode* NodeType*; before line 1, or replace line 4 with ListNode* next;
A generic data type is one in which the operations are defined, but the types of items being manipulated are not.
True
An array-based list automatically gives O(1) length operation, but in a linked implementation, length can be O(1) or O(N) depending on design.
True
To implement a list ADT with an unknown and variable number of components, the best choice is:
A linked list represented as dynamic structs and pointers
Deleting from an unsorted list requires elements below the one being deleted to be moved up one slot.
False
Given only the external pointer to a linked list, inserting at the front is faster than at the back.
True
If currPtr points to a node in a dynamic linked list, currPtr++ advances to the next node.
False
Inserting and deleting in an unsorted list have the same time complexity.
True
What is special about the last node in a dynamic linked list?
Its link member contains the value NULL
Order of inserting an element into its place in an unsorted array-based list:
O(1)
Line labeled //2 should be filled with:
moreToSearch && !found