Final test

Mark the correct/incorrect assertions about Sorting and Searching.
(yes) Selection sort is based upon finding the minimum value in a range of indexes and placing that value at the front of the vector.
(no) Linear search is an O(log n) algorithm.

Can the following line be a definition of the destructor of a class?
(yes) Department::~Department() {}
(no) Dep::~Dep(int i) { cout << i; }

Is it possible to overload the next operators for objects of the well-known class Time, using the given nonmember function declaration?
(yes) long operator-(Time, Time);
(no) Time operator+();

Mark the correct/incorrect statements about Templates and Operator Overloading.
(yes) A class template is a mechanism that allows us to create classes whose data fields have arbitrary type.
(no) The function Time& operator++(Time&) overloads postfix increment operator for Time objects.

Mark the correct/incorrect pointer definitions.
(yes) int* pint = new int;
(no)  int pin = new int;

Mark with "yes" the case(s) when the output sequence of digits corresponds to the input number.
 int dig(int n)
{ cout << n;
  if (n > 9) return dig(n/10) + 1;
  else return 1;
int main()
{ int k; cin >> k;
  cout << dig(k); return 0;
The notation is: <input number> -> <output sequence>
(yes) 122 -> 1221213
(no)  303 -> 3031033

We have the following classes:
class Employee { ... };
class Manager : public Employee { ... };
Mark the correct/incorrect assertions.
(yes) The class Employee is the base class and the class Manager is the derived class.
(no) The class Manager is the base class and the class Employee is the derived class.

We have the following definitions:
ifstream inp;
ofstream out;
int k = 100;
char ch = 'Z';
const double PIN = 5.55;
Mark the syntax correct/incorrect statements.
(yes) out << PIN*k << "\n";
(no) inp << PIN*k << "\n";

Suppose the class D inherits from B. Let b be an object of the class B, d be an object of the class D, pb be a pointer of the class B and pd be a pointer of the class D. Is the following assignment correct?
(yes) pb = static_cast<B*>(pd); 
(no) d = b;

We have the following variable definitions:
int b[3] = {10, 20, 30};
int* pb = b;
Mark with "yes" the expressions which have the value 30.
(yes) b[0] + b[1]
(no) *b

Mark the correct/incorrect assertions about Exception Handling.
(yes) Throwing an Exception means: Abandon current function and throw a value to an exception handler.
(no) A function with throw() specification is allowed to throw any exceptions.

We have a linked list and an iterator:
list<int> slist;
<int>::iterator lit;
The list contains 10 elements and the iterator points to the second element of the list. Mark correct/incorrect (about syntax or logic) expressions:
(yes) *lit > 0
(no) *lit != *slist.end()

We have the following code fragment:
void fun3() { throw runtime_error("RTE" ); }
void fun2() throw(runtime_error) { ... }
void fun1() throw(runtime_error) { fun2(); }
int main()
{ try { fun1(); }
  catch (runtime_error e) { cout << e.what(); }
  return 0;
Replacing ... with the given below statement, the message RTE prints on the screen.
Is this assertion true?
(yes) fun3();
(no) fun1();