Help with college assignment! Please!!!

Hi I study electrical engineering and I need to write this program in order to get the last credit that will allow me to take my final exam. However I can't figure out. Can anyone help me out?

this is the assignment:

1. RLC circuit (1 point)
Given a simple RLC circuit (and the values for each circuit component), write a C/C++ program that computes the impedance of that circuit.
Input:
The RLC circuit is given through an XML-like input file that may contain one or more of the following tags: "circuit", "parallel", "series", "resistance", "coil" and "condenser".
"Circuit" is the root tag and appears only once. "parallel" and "series" tags specify the structure of the circuit elements. For every circuit element (resistance, coil or condenser) the value is given. Tags appear in format: <start_tag></end_tag>; for circuit elements, the values are given separated by quotations (Ex: <resistance>"1"</resistance>)

Example of input file:
<circuit>
<series>
<resistance>"5"</resistance>
<parallel>
<resistance>"2"</resistance>
<series>
<resistance>"1"</resistance>
<coil>"1"</coil>
</series>
</parallel>
<condenser>"2"</condenser>
</series>
</circuit>

1
Output: A value representing the impedance of the equivalent circuit Implementation issues and hints:
The XML-like input is given in a text file which is to be read and parsed. An example input file can be found in the archive UExtra.tgz. Parsing should search for strings delimited by "<","/>" or by quotations. All blanks are skipped.
The easiest way for computing is to use a stack. While parsing the input file, the start tags and circuit elements values are put on the stack. When an end tag is encountered (Ex: "</coil>"), everything until the matching start tag in the stack is popped. Depending on the matching tag, the values for circuit elements are summed, subtracted etc. and the result is pushed back on the stack.

Just a word of advise: C++ is not the easiest programming language out there. You have to deal with memory allocation and such and most of the time this is a very difficult thing for newcomers and amateurs.

Since you study electrical engineering, you are not really required to learn a particular programming language, so I recommend that you try to code in a higher-level language. If you need this portable, try Java. If you only need this to run in Windows, try .Net.
Topic archived. No new replies allowed.