Which of the following correctly fills the blank in the line labeled “//3”?
ItemType UnsortedType::GetItem(ItemType& item, bool& found)
// Pre: Key member(s) of item is initialized.
// Post: If found, item's key matches an element's key in the
// list and a copy of that element has been stored in item;
// otherwise, item is unchanged.
{
bool moreToSearch;
int location = 0;
found = false;
moreToSearch = (location ________ length); // 1
while (__________________) // 2
{
switch (item.ComparedTo(info[location]))
{
case LESS :
case GREATER : location++;
moreToSearch = (_____________); // 3
break;
case EQUAL : found = true;
item = info[___________]; // 4
break;
}
}
return item;
}
| A. |
location > length |
|
| B. |
length >= location |
|
| C. |
location < length |
The last time testing is done is when the user accepts the product after a successful acceptance test.
True
False
Executing every branch and every path at least once is feasible.
True
False
Which of the following correctly fills the blank in the line labeled “//3”? ItemType UnsortedType::GetItem(ItemType& item,...