CMPU-203: Introduction to Computer Science III

Quiz #1
Due: Monday, Jan. 28

  1. Which of the following are valid C++ expressions:
    friend class Person;
    friend int operator + (const A&, const A&);
    friend int c;
    friend bool operator < (const Person&, const Person&);
    
    Hint: the second one is tricky.

  2. What is an abstract class? Is it different from a virtual class?

  3. What is this?

  4. Write a simple template function named noteq. The function takes two arguments and returns true if they are not equal, and false if they are not. The template should allow the function to be called with two arguments of the same data type, provided the data type has an overloaded equality operator.