// driver.cc  P. Conrad CISC181 Spring 2006
// a simple driver program to check syntax of our class
// and to see how a class is used in a program.

#include <iostream>
using std::cout;
using std::endl;

#include "complex.h" // this means pull in the definition of Complex_C
               
// so now, I can declare variables of type Complex_C


int main(void)
{
  Complex_C c; // just like int x; or double y;

  // one advantage of objects from user defined classes, is that
  // I can write some code that gets automatically run everytime I declare
  // a new instance of that variable.
  // That function is the "constructor"... in this case, it will give
  // the c variable a value of "0" for the imaginary part, and "0" for the
  // real part.

  // We know that if I say "int x;" the value of x at that point is
  // whatever bits were left over in memory... the value is "junk bits"
  // the value is "arbitrary".

  cout << "c = ";
  c.print(); // calls the "print() member function" on object called "c"
  cout << endl;

  // I cannot say 
  //    cout << c;
  // unless I overload the << (stream insertion operator) for Complex_C;
  // we'll learn about that in Chapter 8.

  cout << "Now I will call c.setReal(4.0);" << endl;

  c.setReal(4.0);

  cout << "Now c = ";
  c.print();
  cout << endl;

  cout << "Now I will call c.setImag(19.0);" << endl;

  c.setImag(19.0);

  cout << "Now c = ";
  c.print();
  cout << endl;
  


  return 0;
}
