Reference no: EM131406600
C programming
Complex Number Calculator
Create a complex number calculator (For a brief overview on complex numbers, take a look at https://mathworld. wolfram.com/ComplexNumber.html). Your calculator should be able to compute the following:
- Addition of two complex numbers: z1 + z2
- Subtraction of two complex numbers: z1 - z2
- Multiplication of two numbers: z1 z2
- Division of two complex numbers: z1 z2
- Computation of the magnitude and phase (in degrees) of a complex number z. 1
The program should ask the user which of the five operations he wants to perform. It then asks the user to enter the appropriate values for the complex numbers and performs the necessary computation. Your program should execute continuously until the user requests to terminate it.
Sample run:
Press + for addition, - for subtraction, * for multiplication, / for division, m for magnitude and phase, or any other key to exit: +
Enter a complex number: 2 5
Enter a complex number: 1 8
(2+5i)+(1+8i)=(3+13i)
Press + for addition, - for subtraction, * for multiplication, / for division, m for magnitude and phase, or any other key to exit: n
Your program should include the following functions:
1. Void read complex(float *z r, float *z i) // reads a complex number from the keyboard
2. Void print complex(float z r, float z i) // prints a float number on the screen in the form a+bi
3. Void add complex(float z1 r, float z1 i, float z2 r, float z2 i, float *z3 r, float *z3 i) // z3=z1+z2
4. Void sub complex(float z1 r, float z1 i, float z2 r, float z2 i, float *z3 r, float *z3 i) // z3=z2-z1
5. Void mul complex(float z1 r, float z1 i, float z2 r, float z2 i, float *z3 r, float *z3 i) // z3=z1· z2
6. Void div complex(float z1 r, float z1 i, float z2 r, float z2 i, float *z3 r, float *z3 i) // z3=z1 z2
7. Void par complex(float z1 r, float z1 i, float *mag, float *ph) // magnitude and phase
Determine the resulting number of bits for a piece of music
: In a CD player, the sampling rate is 44.1 kHz, and the samples are quantized using a 16 bit/sample quantizer. Determine the resulting number of bits for a piece of music with a duration of 50 minutes.
|
Standard bluetooth communication on an iphone
: What type of antenna is used for standard Bluetooth communication on an iPhone? What are some drawbacks of this design?
|
File signature verification tool provides
: Enumerate the information about system files and device driver files that the File Signature Verification tool provides.
|
Discussion and dropbox assignment
: In a professional environment, you typically create three interface-layout designs and show them to the client. Then, the client and you, together, select one of these designs. The complete website development is based on this design.
|
Complex number calculator
: Complex Number Calculator Create a complex number calculator (For a brief overview on complex numbers, take a look at http://mathworld. wolfram.com/ComplexNumber.html). Your calculator should be able to compute the following:
|
Discuss about the is strategic plan
: Using the IS alignment work and the financial analysis from, submit a complete IS strategic plan. Your paper should include at least 5 references from peer-reviewed journals associated with how other companies are using the technologies you are re..
|
Calculate the average price at which the shares were issued
: Common stock without par value 1,500,000 shares authorized 500,000 shares issued and 540,000 shares outstanding $8,700,000. Required: Calculate the average price at which the shares were issued
|
What is the power in this process
: Assume that-this signal is transmitted using a uniform PCM system with 512 quantization levels, what is the resulting SQNR in decibels and what is the minimum required transmission bandwidth if in sampling the signal a guard band of 1 kHz is used?
|
Information technology foundations
: This is an open-book individual examination. You may use any resources in addition to the course materials, such as other books, articles, and the Web. However, you must do your own work and you may not collaborate with your classmates.
|