#include #include #ifndef _FIRSTCLASS_H #define _FIRSTCLASS_H class FirstClass { // members are private by default! int num; double value; std::string name; public: // Constructors FirstClass(); // default constructor - no parameters FirstClass(int); // conversion constructor - can only have 1 param FirstClass(double, int = 0, std::string = ""); // alternate constructor FirstClass(const FirstClass &); // copy constructor // Destructor ~FirstClass(); // destructor // Accessors - typically we const protect the implicit object std::ostream & write(std::ostream &) const; std::string getName() const {return name;} ; // in-line definition // Mutators std::istream & read(std::istream &); bool setNum(int n); double deltaValue(double delta); private: // Helper Methods bool isValid(int n) { return n > 0 && n < 100; } ; } ; // do not forget semicolon!! #endif