Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 #endifStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started