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

I have created a Resistor.h file for a C++ program. Now I am trying to create a

ID: 3527353 • Letter: I

Question

I have created a Resistor.h file for a C++ program. Now I am trying to create a Resistor.cpp file to implement the public functions in my Resistor.h file. I am having a bit of trouble figuring out the commands to use to accomplish that. Following is my Resistor.h file: #ifndef Resistor_h #define Resistor_h #include using namespace std; class Resistor{ private: double Nom; double Tol; string Name; public: Resistor(double res, double tol, string N, bool c); ~Resistor(); //Destructor void setNom(double Nom, bool fncheck);//memebers void setTol(double Tol, bool fncheck); void setName(string Nm, bool fncheck); double getTol(bool fncheck); double getNom(bool fncheck); string getName(bool fncheck); }; #endifPl Please help.....??

Explanation / Answer

PLEASE RATE ME AND AWARD ME KARMA POINTS IF IT IS HELPFUL FOR YOU First of all, click the code tag button with the on the right side to show the code tag. Type ur codes within the tags. Second, your header file is fine. You have two constructor prototypes, a destructor and a function prototype. 1 2 3 4 cResistor(); cResistor( double m_dResValue, double m_dTolerance); void DisplayResistor(); ~cResistor( ); On your source file you should not put ANY prototypes. Remove the prototypes from the source file. Thirdly, you cannot do that in your main method cResistor::cResistor();. You have to declare a pointer to the object. Try cResistor* resistor = new cResistor(); But your source file does not have any implementation for this constructor either. So it will give error unless you implement this in your source file 1 2 3 cResistor::cResistor() { }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote