{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

complextest

complextest - @file [email protected] William...

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

/** @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;

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

complextest - @file [email protected] William...

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

View Full Document
Ask a homework question - tutors are online