Define the method getPositionfor the class SortedListHasA.
What will be an ideal response?
```
template
int SortedListHasA
{
int position = 1;
int length = listPtr->getLength();
while ( (position <= length) &&
(anEntry> listPtr->getEntry(position)) )
position++;
if ( (position > length) || (anEntry != listPtr->getEntry(position)) )
position = -position;
return position;
} // end getPosition
```
You might also like to view...
In a UML class diagram, the minus (-) indicates:
a. public access b. protected access c. private access d. package access
Which of the following code fragments gives a random double value between 2 and 5 inclusive? You can assume that the random number seed has been set and any needed definitions and initializations have been made.
a. 3.0*rand() + 2
b. 3.0*(RAND_MAX-rand())/RAND_MAX + 2
c. ((RAND_MAX-rand())/static_cast