[IMG]http://i37.tinypic.com/xp0ei0.jpg[/IMG]

#include <iostream>
#include <string>
#include <ostream>
using namespace std;

class CResistor
{
			
	public:
		
		void InputInfo()
		{
			cout<<"Enter a text name for the CResistor object being created."<<endl;
			cin>>m_sResName;
			cout<<"\n";

			cout<<"Enter the Following Data:"<<endl;
			cout<<"Resistance Value= ";
			cin>>Res0;
			cout<<"Tolerance Value= ";
			cin>>Res1;

			ResTolValue=(Res0*Res1);
			Res2=(Res0+ResTolValue);
			Res3=(Res0-ResTolValue);
			cout<<":Max Resistance= "<<Res2<<endl;
			cout<<":Min Resistance= "<<Res3<<endl;
			cout<<"\n";
		
		}
		void DisplayResistor()
		{
			cout<<"\nDisplay:"<<endl;
			cout<<"Resistance Name: "<<m_sResName<<endl;
			cout<<"Resistance Value: "<<Res0<<endl;
			cout<<"Current Tolerance: "<<Res1<<endl;
			cout<<"Max: "<<Res2<<endl;
			cout<<"Min: "<<Res3<<endl;
		}
		void EnterResistance()
		{
			cout<<"\n";
			cout<<"Current Resistance: "<<Res0<<endl;
			cout<<"Enter New Resistance: "<<endl;
			cin>>Res0;
				while(Res0<=0||Res0>10000000)
				{
					cin>>Res0;
				}
			cout<<"Currrent Tolerance: "<<Res1<<endl;
			cout<<"Enter New Tolerance: "<<endl;
			cin>>Res1;
				while(Res1<=0||Res1>50)
				{
					cin>>Res1;
				}
			ResTolValue=(Res0*Res1);
			Res2=(Res0+ResTolValue);
			Res3=(Res0-ResTolValue);
			
		}

	private:
		double ResTolValue;
		double Res0,Res1,Res2,Res3 ;
		string m_sResName;

};

int main()
{
	CResistor First;
	First.InputInfo();
	CResistor Second;
	Second.DisplayResistor();
	CResistor Third;
	Third.EnterResistance();
	CResistor Last;
	Last.DisplayResistor();
	return 0;
}
cout.setf(std::ios_base::fixed, std::ios_base::floatfield);

See your other post. Just put this inside main, near the beginning.

This article has been dead for over six months. Start a new discussion instead.