Question
IN C++ In lecture we went over the Rat class. Here the question is to write a Complex ( imaginary number ) class; using namespace
IN C++
In lecture we went over the Rat class. Here the question is to write a Complex ( imaginary number ) class;
using namespace std;
class Complex { private:
double r;
double i;
public:
Complex();
overloaded add function for Complex should return Complex
overloaded subtract function for Complex should return Complex
overloaded multiply function for Complex should return Complex
overloaded divide function for Complex should return Complex
get and set for both r and i
overloaded input and output functions for Complex };
for the definitions of the arithmetic functions see here:
http://en.wikipedia.org/wiki/Complex_number#Addition_and_subtractio
Step 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