/*
 * Sonny Rajagopalan
 * CISC181-040 J (Summer 2006).
 * Having fun with the "this pointer" etc.
 */
#include <iostream>
using namespace std;

class Complex
{
  double a;
  double b;
public:
  Complex();
  Complex(double, double);
  void print();
};

Complex::Complex ()
{
  cout << "Calling default constructor..." << endl;
  a=1.0;
  b=1.0;
}

Complex::Complex(double x, double y)
{
  cout << "Calling constructor..." << endl;
//   this->a=x;
//   this->b=y;
  a=x;
  b=y;
}

void Complex::print()
{
  cout << "The complex number is " << a << " + " << b << "i" << endl;
}

int main()
{
  Complex a;
  Complex b(1.2, 3.3);
  a.print();
  b.print();

  return 0;
}

