Resistor class

Hello c++ gurus.

I'm back to using c++ for a class I'm taking and I return to you guys for guidance and help. OK so my project this time consists of having to create a multi-file project. I've been given the main.cpp for this project but I am to create the class file for it. It is supposed to be a resistor class. Here is what I have so far...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

class resistor
{
public:
	string m_cResistorName;
    void StoreResistance(); 
    void StoreTolerance (); 
    ResistorClass(); 

private:
    double resistance;
    double Tolerance;
};
int main()
{	
	system("pause");

	return 0;	
}


Here is what the class is supposed to do...
1.store the nominal resistance value of a resistor
2.store the tolerance of a resistor
3.initialize any and all nominal-resistance values to correct, EIA, nonzero values that are greater than 0 and less than 1,000,000 ohms
4.initialize any and all resistance-tolerance values to correct, E12, E24, E48, or E96 resistance-tolerance values
5.allow the nominal-resistance and tolerance values of a resistor object to be changed by the user
6.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(). a.If the Boolean value = true, display the message.
b.If the Boolean value = false, do not display the message.

As you can see I'm lost. Any and all help is appreciated. Thanks in advance.
The constructor of a class is always named after the class. So:

ResistorClass();

should be

resistor();

because you named your class

class resistor
{
public:

Its within the resistor constructor that you want to initialize everything.
Oh OK. So with those pointers here is what I have now...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

class resistor
{
	private:
    double resistance;
    double Tolerance;
public:
	resistor(double rL,double tL);
	~resistor();
    void StoreResistance(double rL); 
    void StoreTolerance (double tL); 
    resistor(); 
};
int main()
{	
	system("pause");

	return 0;	
}


OK so here is a rookie question here... How do I test this thing? Since this is a multifile project do I need to store the files in a single folder or do I open up another tab in Visual Basic and run a debugger there? I hope that question makes sense.
With some more digging and help from my professor here is the code that I have now...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

class resistor
{
	private:
    double resistance;
    double Tolerance;
public:
	resistor(double rL,double tL);
	~resistor();
    void StoreResistance(double rL);
	double getResistance();
    void StoreTolerance (double tL);
	double getTolerance();
    resistor(); 
};
int main()
{	
	system("pause");

	return 0;	
}
Topic archived. No new replies allowed.