Question: Sample Run: **** Complex Numbers Enter 1st complex number real and imaginary parts separated by space: -5.5 6 Enter 2nd complex number real and imaginary

 Sample Run: **** Complex Numbers Enter 1st complex number real and
imaginary parts separated by space: -5.5 6 Enter 2nd complex number real

Sample Run: **** Complex Numbers Enter 1st complex number real and imaginary parts separated by space: -5.5 6 Enter 2nd complex number real and imaginary parts (non-zero) separated by space: 4.31 Results: Addition Results: 1.27 Subtraction Results: 9.85 Multiplication Results: -29.65 20.3i Division Results: 0.9055931.605950 Run again (y or Y) or any other character to end? y Enter 1 st complex number real and imaginary parts separated by space: 54 Enter 2 nd complex number real and imaginary parts (non-zero) separated by space: 30 >>> ERROR: Both numbers must be non-zero - try again! e Enter Znd complex number real and imaginary parts (non-zero) separated by space: 04 >>> ERROR: Both numbers must be non-zero - try againl e Enter 2nd complex number real and imaginary parts (non-zero) separated by space: 34 Results: Addition Results: 881 Subtraction Results: 20Oi Multiplication Results: - 1 32i Division Results: 1.240.32i Run again (y or Y ) or any other character to end? y Enter 1st complex number real and imaginary parts separated by space: 03 Enter 2 nd complex number real and imaginary parts (non-zero) separated by space: 43 Results: Addition Results: 46i Subtraction Results: 40i Multiplication Results: -9 12i Division Results: 0.36 0.48i Run again (y or Y) or any other character to end? Project Specifications: - All code for this program should be contained in one .cpp file. - Define a struct named "ComplexNumber" which should contain two double variables to hold the real and imaginary parts. - This program should allow the user to enter two complex numbers. Each number will be entered as two doubles - one for the real part and one for the imaginary part. First number entered should be stored in a ComplexNumber variable named num1; second number entered should be stored in a ComplexNumber variable named num2. - Validate that neither the real nor imaginary part of num 2 is equal to 0 . Re-prompt the user until a valid number is entered. - Write functions to perform listed mathematical operations on the two numbers entered (num1 and num2) and returns a ComplexNumber and stores the returned ComplexNumber in a variable named result. Each of the following functions will be called in sequence on the two numbers entered by the user. ComplexNumber addComplexNumbers(ComplexNumber num1, ComplexNumber num2); ComplexNumber subtractComplexNumbers(ComplexNumber num1, ComplexNumber num2); ComplexNumber multiplyComplexNumbers(ComplexNumber num1, ComplexNumber num2); ComplexNumber divideComplexNumbers(ComplexNumber num1, ComplexNumber num2); - After each computation display the result: void displayComplexNumber(ComplexNumber num); - Program should allow multiple runs using a do...while loop. - See Sample Run below for input/output requirements and formatting for this program. Helpful Links: - Link for reviewing complex number math operations: Complex Number Formulas - Link for checking results: Complex Number Calculator Submission Requirements: - Zipped Visual Studio project folder appropriately named. - Text file containing sample run with additional tests appropriately named. Sample Run on next page

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!