The figure below shows a frequently used electric circuit called a voltage divider. The input to the

Question:

The figure below shows a frequently used electric circuit called a “voltage divider”. The input to the circuit is the voltage vi. The output is the voltage vo. The output of a voltage divider is proportional to the input, and the constant of proportionality is called the “gain” of the circuit. The voltage divider is represented by the equation

where G is the gain and R1 and R2 are the resistances of the two resistors that comprise the voltage divider.

Manufacturing variations cause the actual resistance values to deviate from the nominal values, as described in Exercise P8.20. In turn, variations in the resistance values cause variations in the values of the gain of the voltage divider. We calculate the nominal value of the gain using the nominal resistance values and the actual value of the gain using actual resistance values. Write a program that contains two classes, VoltageDivider and Resistor. The Resistor class is described in Exercise P8.20. The VoltageDivider class should have two instance variables that are objects of the Resistor class. Provide a single constructor that accepts two Resistor objects, nominal values for their resistances, and the resistor tolerance. The class should provide public methods to get the nominal and actual values of the voltage divider’s gain. 

Write a main method for the program that demonstrates that the class works properly by displaying nominal and actual gain for ten voltage dividers each consisting of 5 percent resistors having nominal values R1 = 250 Ω and R2 = 750 Ω.


Data from Exercise P8.20

The colored bands on the top-most resistor shown in the photo below indicate a resistance of 6.2 kΩ ±5 percent. The resistor tolerance of ±5 percent indicates the acceptable variation in the resistance. A 6.2 kΩ ±5 percent resistor could have a resistance as small as 5.89 kΩ or as large as 6.51 kΩ. We say that 6.2 kΩ is the nominal value of the resistance and that the actual value of the resistance can be any value between 5.89 kΩ and 6.51 kΩ.

Write a program that represents a resistor as a class. Provide a single constructor that accepts values for the nominal resistance and tolerance and then determines the actual value randomly. The class should provide public methods to get the nominal resistance, tolerance, and the actual resistance. Write a main method for the program that demonstrates that the class works properly by displaying actual resistances for ten 330 Ω ±10 percent resistors.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: