I just got into class and objects, and I am very confused in a whole as to why I am getting so many errors and why I can't return values. The program is suppose to be a console application that creates a class and a program that tests each member of that class, which I have all listed. Pretty much I am modeling and testing a resistor.
I still have more code to put in, but I can't get past these basics...
I have a descriptive UML made up if it would help to post that. Just ask.
CODE
#include <iostream>
using namespace std;
class ResistorClass
{
private:
double m_dResValue;
double m_dTolerance;
double m_dMinResistance;
double m_dMaxResistance;
public:
string m_cResistorName;
int DisplayResistor( );
int EnterResistance ( );
int AddSeries (ResistorClass Resistor1, ResistorClass Resistor1);
};
int main (void)
{
//instatiate a resistor
ResistorClass Resistor1;
//give the resistor a %
Resistor1.setm_dResValue(10.0);
Resistor1.setm_dTolerance(0.10);
Resistor1.setm_dMinResistance(9.0);
Resistor1.setm_dMaxResistance(11.0);
//output some facts about resistor one
cout << "Resistor Class Test\n\n";
cout << "Total resistance is " << Resistor1.m_dResValue() << endl;
cout << "Ohm resistance is " << Resistor1.m_dTolerance() << endl;
cout << "Minimum resistance is " << Resistor1.m_dMinResistance() << endl;
cout << "Maximum resistance is " << Resistor1.m_dMaxResistance() << endl;
return 0;
}
void ResistorClass::getResistor1
{
Resistance = m_dResValue;
Resistor ohm tolerance = m_dTolerance;
Minimum resistance = m_dMinResistance;
Maximum resistance = m_dMaxResistance;
}