I need to create a ResistorClass overloaded logical OR operator function which shall do the following:
Overload the logical OR operator ( || ) to calculate the equivalent parallel resistance of the nominal values ( m_dptrRes[0]) of two Resistor Class objects.
The formula for calculating parallel resistance is:
NominalValue1 * NominalValue2 / (NominalValue1 + NominalValue2)
Compare the tolerance values of the two objects and set the tolerance value ( m_dptrRes[1]) equal to the larger of the two tolerance values.
Print the message "Overloaded Resistor Parallel Resistance Operator Called"
the expected output is:
parameterized constructor called
parameterized constructor called
parameterized constructor called
parameterized constructor called
Overloaded Resistor + Series Resistance Operator Called
parameterized constructor called
Overloaded Resistor Assignment = Operator Called
destructor call for SeriesResult
Current Object Count is 4
Overloaded Resistor || Parallel Resistance Operator Called
parameterized constructor called
Overloaded Resistor Assignment = Operator Called
destructor call for ParallelResult
Current Object Count is 4
Values for SeriesResult are:
Resistor Nominal Value = 3000.00
ohmsResistorTolerance = 20.00%
Mininimum Resistance = 2400.00 ohms
Maximum Resistance = 3600.00 ohms
Values for ParallelResult are:
Resistor Nominal Value = 666.67
ohmsResistorTolerance = 20.00%
Mininimum Resistance = 533.33 ohms
Maximum Resistance = 800.00 ohms
destructor call for ParallelResult
Current Object Count is 3
destructor call for SeriesResult
Current Object Count is 2
destructor call for Res2
Current Object Count is 1
destructor call for Res1
Current Object Count is 0