00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <fstream>
00023 using namespace std;
00024
00025
00026 #include <SawComplex.h>
00027
00028 int main(int argc, char *argv[]){
00029
00030 cout << "****************************************************" << endl ;
00031 cout << "* *" << endl ;
00032 cout << "* COMPEX NUMBER MANIPULATION *" << endl ;
00033 cout << "* *" << endl ;
00034 cout << "* Nestor Aguirre 2006 *" << endl ;
00035 cout << "* nfaguirrec@unal.edu.co *" << endl ;
00036 cout << "* *" << endl ;
00037 cout << "****************************************************" << endl ;
00038 cout << endl ;
00039
00040 cout << "------------------------------------" << endl ;
00041 cout << " Using cartesian representation " << endl ;
00042 cout << "------------------------------------" << endl ;
00043 cout << endl ;
00044 SawComplex complex1(2.45, 2.36) ;
00045 cout << "A = " << complex1 << endl ;
00046 cout << endl ;
00047
00048 cout << "--------------------------------" << endl ;
00049 cout << " Using polar representation " << endl ;
00050 cout << "--------------------------------" << endl ;
00051 cout << endl ;
00052 SawComplex complex2(2.45, 2.36, SawComplex::POLAR_REPRESENTATION ) ;
00053 cout << "B = " << complex2 << endl ;
00054 cout << endl ;
00055
00056 cout << "------------------------------------" << endl ;
00057 cout << " Using the association operator " << endl ;
00058 cout << "------------------------------------" << endl ;
00059 cout << endl ;
00060 SawComplex complex3 ;
00061 complex3 = complex1 ;
00062 cout << "C = " << complex1 << endl ;
00063 cout << endl ;
00064
00065 return EXIT_SUCCESS;
00066 }