Reference no: EM132299245
Programming For Engineers and Scientists Assignment -
This assignment is broken up into 3 parts.
IMPEDANCE, VOLTAGE AND CURRENT CALCULATOR FOR SIMPLE AC CIRCUIT
BACKGROUND -
An Alternating Current (AC) circuit is one in which the output of the voltage source changes with time. When we add components to the circuit, the voltage and current will be different at different points in the circuit. The components we will be looking at are resistors, capacitors and inductors.
Impedance is the measure of the resistance and reactance of a component or circuit. Resistance is a measure of friction against the motion of electrons, whereas reactance is the inertia against the motion of electrons. Impedance introduces a phase shift between the voltage and current through a component, and hence is expressed as a complex number. Do not worry too much if this doesn't make sense, you can just think of this as complex resistance.
PROBLEM - PART 1
You are to create a program that allows a user to view the impedance for each component and the total in a series circuit. The program will ask the user for the frequency, the number of components, and the values of each component.
PROBLEM - PART 2
You are to create a program that allows a user to view the impedance for each component and the total in either the parallel circuit (a) or series circuit (b). The program will ask the user for the circuit type, the frequency, the number of components, and the values of each component.
PROBLEM - PART 3
You are to create a program that allows a user to view the voltage, current and impedance for each component and the total in either the parallel circuit (a) or series circuit (b). The program will ask the user for the circuit type, the source voltage, the frequency, the number of components, and the values of each component.
Note - The generic example circuits are shown in attached file.
CONSTRAINTS -
- Pi needs to be to 11 decimal places in your program.
- You are only allowed to include the stdio.h and stdlib.h header files. No others. Do not use conio.h.
- You cannot use goto statements.
- Formatting needs to be exactly as specified. (Your program will be tested against automated test cases).
- Text to user needs to be easily understandable. You can change the text but the same inputs must be used. No extra newlines.
- The program must print YOUR student number, name and the assignment number as specified.
- The program must print the password as specified.
- The code must be done using ANSI C and compile on latcs5.cs.latrobe.edu.au using gcc.
- Code must not crash or have the potential to crash due to stack overflow or segmentation fault.
- Types should be used appropriately.
- Variables should be limited to an appropriate scope.
- You must use comments to explain significant lines of code. Read documentation guide.
- You must use comments to explain how to use the functions and solution.
Attachment:- Assignment File.rar