Question: C++ (class,constructors ,overloading operator) In this assignment you are required to implement and test the class Complex for performing arithmetic with complex numbers You shall
C++ (class,constructors ,overloading operator)



In this assignment you are required to implement and test the class Complex for performing arithmetic with complex numbers You shall use all the concepts you learned so far, more precisely how to use constructors (e.g when an object is created) and how to overload basic operators such as +, *, and the output and input operators Recall that complex numbers have the form reaiPart imagina r vPart * i where is equal to the square root of (-1) We next give the basic class Complex that you are expected to extend and implement. #ifndef COMPLEXH #define COMPLEX H - class Complex ublic: Complex (doble 0.0, double 0.0 );// default constructor double getReal ) const, double getlmaginary () const void setReal (double); void setlmaginary (double) // returns real part // returns imaginary part // sets real part // sets imaginary part rivate: double real double imaginary l: // end class Complex #endif
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
