Interactive Quiz for Chapter 14

Question
Your Answer Result/Explanation
14.1
Suppose s1 and s2 are two strings, rewrite operator+(s1, s2) using a simpler expression.
14.2
Suppose s1 and s2 are two strings, rewrite operator>=(s1, s2) using a simpler expression.
14.3
Suppose s is a string, rewrite operator[](0) using a simpler expression.
14.4
Suppose r is a Rational object, rewrite r.operator++() using a simpler expression. .
14.5
Suppose r is a Rational object, rewrite r.operator++(0) using a simpler expression.
14.6
What are copy constructor, the assignment operator, and the destructor are together called?
14.7
What is the output of the following code?
    #include 
    using namespace std;

    class A {
    public:
      A(int i) {
        this->i = i;
      }

      A operator+(A a) {
        return A(this->i + a.i);
      }

      int getI() {
        return i;
      }

    private:
      int i;
    };

    int main()
    {
      A a1(3);
      A a2(4);
      A a3 = a1 + a2;
      cout << a3.getI() << endl;

      return 0;
    }