Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ There are three variations of the same formula shown below: where V = voltage (volts), I = current (amperes), and R = resistance (ohms)

C++

There are three variations of the same formula shown below:

image text in transcribed

where V = voltage (volts), I = current (amperes), and R = resistance (ohms)

To find the Current through a Circuit, the following derivation of the equation is used.

image text in transcribed

To find the Resistance through a Circuit, the following derivation of the equation is used.

image text in transcribed

When more than one path through a circuit is available, the Equivalent Resistance of a circuit must be calculated with the following equation:

image text in transcribed

Develop a module named ohm.cpp with a corresponding ohm.h file that declares and defines the following function templates:

float getVoltage(float amperes, float ohms);

float getCurrent(float volts, float ohms);

float getResistance(float volts, float amperes);

float getEquivalentResistance(float ohms[], unsigned int size);

Finally, implement a main module called ohmsLaw.cpp that tests each function by prompting the user for each value on a single line of input as follows:

c:\> ohmsLaw.exe

enter the current and resistance to get the circuit voltage: 10.0 12.0

answer: 120 volts

enter the voltage and resistance to get the circuit current: 120.0 10.0

answer: 10 amperes

enter the voltage and current to get the circuit resistance: 120.0 10.0

answer: 12 ohms

enter the number of resistors and their values to calculate the equivalent resistance: 3

enter the ohm value for resistor 1: 3.0

enter the ohm value for resistor 2: 4.0

enter the ohm value for resistor 3: 5.0

answer: 0.2 ohms

enter 'q' to quit: q

c:\>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

Students also viewed these Databases questions