complextest - /* */ @file complextest.cpp @author William...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** @file complextest.cpp @author William Duncan @date 2005-10-01 Description: program to test the complex class implementation Course: CS1254.02 Logon ID: cs1254xx Lab #: 2 Instructor: William Duncan */ #include <iostream> #include "complex.h" #include <cstdlib> #include <cmath> using namespace std; namespace cmplx = CSC1254_complex; using namespace cmplx; int main(int argc, char **argv) { Complex z1(4,-2); Complex z2(-4,2); Complex z3(-4,-3); Complex z4(3,-4); Complex z5; Complex z6; Complex z7; double ang; cout<<"z1 = "<<z1<<endl; cout<<"z2 = "<<z2<<endl; cout<<"z3 = "<<z3<<endl; cout<<"z4 = "<<z4<<endl; cout<<"z2 x z3 = "<<z2*z3<<endl; cout<<"z1 + z2 = "<<z1+z2<<endl; cout<<"z3 = "<<z3<<endl; cout<<"z4 = "<<z4<<endl; cout<<"z3-z4 = "<<z3-z4<<endl; cout<<"((z2+z3)x(z3-z4)) = "; cout<<(z2+z3)*(z3-z4)<<endl; cout<<"((z2+z3)x(z3-z4))/z3 = "; z6 = ((z2+z3)*(z3-z4))/z3; cout<<z6<<endl; cout<<"z3 / z4 = "<<(z3/z4)<<endl; cout<<"Conj(z4) = "<<z4.conjugate()<<endl; cout<<"The conjugate of z4 is "<<(z4.conjugate())<<endl;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Page1 / 2

complextest - /* */ @file complextest.cpp @author William...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online