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

I have created the following Filter.h file. I am getting some errors, preventing

ID: 440650 • Letter: I

Question

I have created the following Filter.h file. I am getting some errors, preventing it from compiling. Would someone be able to take a look and point out where my errors are and how to fix them?


#ifndef Filter_h

#define Filter_h

#include <string>

using namespace std;


class Filter{


public:

Filter(double initialNomR, double initialtolR, double initialNomC, double initialTolC);

Filter();

double getR();

double getRTolerance();

double getC();

double getCTolerance();

double getCutOffFrequency();

void setR(double newNominalR, double newTol);

void setC(double newNomC, double newtol);


private:

Resistor FiltRes;

Capacitor FiltCap;

double cutOffFrequency;

double minCutOffFrequency;

double maxCutOffFrequency;

double filterTol;

string filterType;


};

#endif

Explanation / Answer

The problem is this: You are declaring: Resistor FiltRes; Capacitor FiltCap; Here Resistir and Capacitor are not defined. So your code does not know the classes for them. If you have classes corresponding to these types, you will have to import it in you .cpp file Cheers! Please rate :)