Question: #include #include using namespace std; #include int conjugate(); int polar(); int rec_polar int subtraction(); int multiplication(); int main(); { int choice = 0; while (true)
#include
using namespace std; #include
//use of conj() cout<< conj(mycomplex) << endl; return 0; } int polar() { double magnitude = 0.0, phase = 0.0; cout << "Enter the magnitude:"; cin >> magnitude; cout << "Enter the phase angle:"; cin >> phase; cout << "The complex whose magnitude is" << magnitude; cout << "and phase angle is" << phase;
//use of polar() cout<< "is " << polar(magnitude, phase) << endl;
return 0; } int rec_polar() { double x, y, distance = 0.0, angle = 0.0; cout << "Enter X value:"; cin >> x; cout << "Enter Y value:"; cin >> y; cout << "Your Coordinate:(" << x << "," << y << ")" << endl; const double ToDegrees = 180.0 / 3.141593;//Defined to convert Radians to Degrees distance = sqrt(x * x + y * y); angle = atan(y / x) * ToDegrees; cout << "r:" << distance << endl; cout << "Theta: " < , angle << endl; } int subtraction() { double real = 0.0, img = 0.0; double real11 = 0.0, img1 = 0.0, real2 = 0.0, img2 = 0.0; cout << "Enter the real and imaginary part of 1st number:"; cin >> real1; cin >> img1; cout << "Enter the real and imaginary part of 1st number:"; cin >> real 2; cin >> imag2; cout << "Subtraction result:"; cout << "Real:" << real1 - real2 << endl; cout << "Imaginary:" << img1 - img2 << endl; }int multiplication() int x1, y1, x2, y2, x3, y3; cout << "Enter the first complex number:" << endl; cin >> x1 >> y1; cout << " Enter second complex number:" << endl; cin >> x2 >> y2; x3 = x1 * x2 - y1 * y2; y3 = x1 * y2 + y1 * x2; cout << "The value after multiplication is:" << x3 << "+" << y3 << "i" << endl; return 0; }
2. Instructions: Fix the error line of the Programm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
