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

STEP 2: Required Class Members Back to top The resistor class will, at minimum,

ID: 3633479 • Letter: S

Question

STEP 2: Required Class Members
Back to top

The resistor class will, at minimum, have members that do the following.

store the nominal resistance value of a resistor
store the tolerance of a resistor
initialize any and all nominal-resistance values to correct, EIA, nonzero values that are greater than 0 and less than 1,000,000 ohms
initialize any and all resistance-tolerance values to correct, E12, E24, E48, or E96 resistance-tolerance values
allow the nominal-resistance and tolerance values of a resistor object to be changed by the user
All member functions should have a test message stating the name of the function. All the test messages should be displayed or not displayed, depending on the value of a Boolean variable declared in main().
If the Boolean value = true, display the message.
If the Boolean value = false, do not display the message.

STEP 3: Program Operations


Function main() should instatiate two objects of class resistor.
Function main() should display the current values of all resistor objects.
Function main() should also calculate and display the minimum and maximum in-tolerance resistance values of each resistor object from the resistor data members.
Function main() should allow the user to change the values of the nominal resistance and the resistor tolerance of both resistor objects, and it should also correctly handle out of numeric-range input. Main() is also responsible for making sure that the user can successfully enter only correct, EIA resistance and tolerance values.
The user should be given the following data-entry choices:
accept current EIA values for resistance and tolerance;
The function main() should display the new, modified values of the resistor object, including the new min and max in-tolerance resistance values.
The function main() should be executed twice: once with the test messages displayed and once without.

***Add these steps to the code below.

// file Resistor.h
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
class Resistor
{
private:
string name;
double value;
double tolerance;
double minValue;
double maxValue;
public:
void DisplayResistor();
void GetResistance();
};
// file Resistor.cpp
#include "Resistor.h"

void Resistor::DisplayResistor()
{
};
void Resistor::GetResistance()
{
};

// file Main.cpp
#include "Resistor.h"

void main()
{
Resistor R1, R2;
// Simple centered title line for resistor program
cout<<setw(50)<<"Resistance is Futile ";
R1.GetResistance();
R1.DisplayResistor();
R2.GetResistance();
R2.DisplayResistor();
}

Explanation / Answer

// file Resistor.h #include #include #include using namespace std; class Resistor { private: string name; double value; double tolerance; double minValue; double maxValue; public: void DisplayResistor(); void GetResistance(); }; // file Resistor.cpp #include "Resistor.h" void Resistor::DisplayResistor() { }; void Resistor::GetResistance() { }; // file Main.cpp #include "Resistor.h" void main() { Resistor R1, R2 // Simple centered title line for resistor program cout