Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Overview:Create and test a class that models aresistor. Resistor Class UML Diagr

ID: 3608197 • Letter: O

Question

Overview:Create and test a class that models aresistor.

Resistor Class UML Diagram:

Resistor ClassMember Specifications:

NOTE: All decimal pointsmust be aligned and upper and lowercaseletters shown. Also, note that the resistor's tolerance isstored as a decimal (0.10) it is displayed as a percentage(10%).

(See chapter 3 in our text book for details on the outputformatting functions: setw(), left, right, setpercision, fixed,showpoint...)

m_dResValue >= 0 &&m_dResValue < 10,000,000

The value entered for tolerancemust be a whole number and not a decimal.

The program should force the userto continue data entry until acceptable values are entered (use aloop).

After valid data has been enteredfor the nominal and tolerance members the function should calculatenew values for m_dMinResistance and m_dMaxResistance. The formula'sthese calculations are as follows:

m_dMinResistance = m_dResValue -(m_dResValue * m_dTolerance);

m_dMaxResistance = m_dResValue +(m_dResValue * m_dTolerance);

After all data entry andcalculations are completed the DisplayResistor function willbe called.

NOTE: Eventhough tolerance will be stored as a decimal, all user input anddisplay output should be in percentageformat. For example, a value of 10% tolerance would beentered as 10<ENTER> and would be displayed as 10.0%, butwould be stored in the member variable m_dTolerance as0.10.

The objects to be summed arepassed as arguments to the AddSeries function. The results aresaved to the calling object's data members.

The sum of the two resistorobjects' nominal values will be stored in m_dResValue.

The new tolerance value will bethe larger of the two resistor objects'm_dTolerance members (you'll need an if-statement).

New values for m_dMinResistance and m_dMaxResistance will becalculated using the following formulas:

m_dMinResistance = m_dResValue -(m_dResValue * m_dTolerance);

m_dMaxResistance = m_dResValue +(m_dResValue * m_dTolerance);

Class:ResistorClass + stringm_cResistorName;
- double m_dResValue;
- double m_dTolerance;
- double m_dMinResistance;
- double m_dMaxResistance; + voidDisplayResistor(void )
+ void EnterResistance (void)
+ void AddSeries (ResistorClass Resistor1, ResistorClassResistor2)

Explanation / Answer

#includeusing namespace std;class ResistorClass{public: //+ sign membrstring m_cResistorName;void DisplayResistor(void ){cout