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 #include

using namespace std; #include int conjugate(); int polar(); int rec_polar int subtraction(); int multiplication(); int main(); { int choice = 0; while (true) { cout << "Press 1 to calculate subtraction of Numbers "; cout << "Press 2 to calculate multiplication of Numbers "; cout << "Press 3 to calculate conjugate operation "; cout << "Press 4 to conversion of rectangular to polar coordinates "; cout << "Press 5 to print the complex number in polar form. "; cout << "Press 6 to exit "; cin >> choice; switch (choice) { case 1: { subtraction(); break; } case 2: { multiplication(); break; } case 3: { conjugate(); break; } case 4: { rec_polar(); break; } case 5: { polar(); break; } case 6: { return 0; } default: printf("Wrong Input "); } } } int conjugate() { double real = 0.0, img = 0.0; cout << "Enter the real and imaginary part:"; cin >> real; cin >> imag; std::Complex my complex(real.img); cout << "The conjugate of" << my complex << "is:";

//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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!