Download 1 - UTRGV Faculty Web

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Integrating ADC wikipedia , lookup

Transistor–transistor logic wikipedia , lookup

CMOS wikipedia , lookup

Valve RF amplifier wikipedia , lookup

Power MOSFET wikipedia , lookup

Surge protector wikipedia , lookup

Power electronics wikipedia , lookup

Voltage regulator wikipedia , lookup

Operational amplifier wikipedia , lookup

Multimeter wikipedia , lookup

Schmitt trigger wikipedia , lookup

Two-port network wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Current source wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Opto-isolator wikipedia , lookup

Network analysis (electrical circuits) wikipedia , lookup

Rectiverter wikipedia , lookup

Current mirror wikipedia , lookup

Ohm's law wikipedia , lookup

Transcript
Lab 1 help
Dr. Abraham
Help for lab #1. I will give you this kind of
assistance for first two labs after that you
are expected follow these examples.
Ohm's Law
For now all output is to the screen. I will
teach you how to redirect the output to a
file in the near future. Because it is on
the screen, you need to capture the screen
an include it with the source code so that
the TAs can give you a grade.
In an electrical circuit, a current is
generated if voltage is applied across one
or more resistances.
Write a program to calculate Current (amps) in
a parallel circuit, given values of three
resistors and voltage applied.
The Ohm’s law states I = V/R, where I =
current in amperes, V = voltage in volts,
and R is the total resistance (ohms) in
the circuit).
Since there are three resistors in this
parallel circuit,
figure out how to find the total resistance.
The total resistance of a set of resistors
in parallel is found by
adding up the reciprocals of the resistance
values.
R = 1.0 /(1.0/resistance1 + 1.0/restistance2
+ 1.0/resistance3)
Program:
1. Make sure you have all the preprocessors as
in the Hello world program. If you want
send your output to a file you need to
#include <fstream>
2. You need to have two functions: main () and
findTotalResistance. You need to declare
the prototype for the later.
3. In the main declare the variables you need
to use, such as the voltage, three
different resistors, and amp.
4. Read the inputs: applied voltage and
resistor values.
5. Call the function to calculate total
resistance, pass the three resistor values.
6. Find the amperage
amp = volt/R;
7. Output the current in amps.