(2+2i)(2+2i) =
= 2(2) +2(2i) +2i(2) +2i(2i)
= 4 + 4i +4i +4i^2
= 4 + 8i -4 (since i^2 = -1)
= 8i
Question 1 (1 point) If you multiplied the two complex numbers below, what would be the...
Create a class called Complex for performing arithmetic with complex numbers. Complex numbers have the form: realPart + imaginaryPart * i where i is √-1 Use double variables to represent the private data of the class. Provide a constructor that enables an object of this class to be initialized when it’s declared. The constructor should contain default values of (1,1) i.e. 1 for the real part and 1 for the imaginary part. Provide public member functions that perform the following...
3. (10 pts) Design an algorithm how to multiply two complex numbers abi and c + di using only three multiplications of real numbers. Your algorithm should take a, b, c and d as input and produce the real component a*c-b*d and the imaginary component a*d + b*c separately MULTIPLY-COMPLEX-NUMBER(a, b, c, d) 3. (10 pts) Design an algorithm how to multiply two complex numbers abi and c + di using only three multiplications of real numbers. Your algorithm should...
C++ //add as many comments as possible 5. A complex number consists of two components: the real component and the imaginary component. An example of a complex number is 2+3i, where 2 is the real component and 3 is the imaginary component of the data. Define a class MyComplexClass. It has two data values of float type: real and imaginary This class has the following member functions A default constructor that assigns 0.0 to both its real and imaginary data...
Define a class named COMPLEX for complex numbers, which has two private data members of type double (named real and imaginary) and the following public methods: 1- A default constructor which initializes the data members real and imaginary to zeros. 2- A constructor which takes two parameters of type double for initializing the data members real and imaginary. 3- A function "set" which takes two parameters of type double for changing the values of the data members real and imaginary....
C++ Create a class called Complex for performing arithmetic with complex numbers. Write a program to test your class. Complex numbers have the form realPart + j imaginaryPart Use double variables to represent the private data of the class. Provide a constructor that enables an object of this class to be initialized when it is declared. The constructor should contain default values in case no initializers are provided. Provide public member functions that perform the following tasks: Adding two Complex...
C++ Complex Class! Create a class called Complex for performing arithmetic with complex numbers. Write a program to test your class. Complex numbers have the form realPart + imaginaryPart * i where i is Squareroot -1 Use double variables to represent the private data of the class. Provide a constructor that enables an object of this class to be initialized when ifs declared. The constructor should contain default values in case no initializers are provided. Provide public member functions that...
Given two complex numbers, find the sum of the complex numbers using operator overloading. Write an operator overloading function ProblemSolution operator + (ProblemSolution const &P) which adds two ProblemSolution objects and returns a new ProblemSolution object. Input 12 -10 -34 38 where, Each row is a complex number. First element is real part and the second element is imaginary part of a complex number. Output -22 28 Two complex numbers are 12-10i and -34+38i. Sum of complex numbers are =...
C++ Addition of Complex Numbers Background Knowledge A complex number can be written in the format of , where and are real numbers. is the imaginary unit with the property of . is called the real part of the complex number and is called the imaginary part of the complex number. The addition of two complex numbers will generate a new complex number. The addition is done by adding the real parts together (the result's real part) and adding the...
Create a class for working with complex numbers. Only 2 private float members are needed, the real part of the complex number and the imaginary part of the complex number. The following methods should be in your class: a. A default constructor that uses default arguments in case no initializers are included in the main. b. Add two complex numbers and store the sum. c. Subtract two complex numbers and store the difference. d. Multiply two complex numbers and store...