I am a part time college student getting his butt kicked in C++.
I dont know how to access the members of the class in this header file. How do I do it? And please use plain english.
Thanks
// Specification file for the Complex class
// constructor included.
#ifndef Complex_H
#define Complex_H
class
Complex {
private:
const double _realPart;
const double _imaginaryPart;
public:
Complex(double realPart=1.1, double imaginaryPart=2.2): _realPart(realPart), _imaginaryPart(imaginaryPart)
{
//The code in the right of the colon servers to initialize the constructor.
// _realPart=realPart and _imaginaryPart=imaginaryPart.
}
void display() const;
double getRealPart() const { return _realPart; }
double getImaginaryPart() const { return _imaginaryPart; }
Complex multiply(const Complex& other) const;
Complex add(const Complex& other) const;
Complex subtract(const Complex& other) const;
};
#endif