// motor.h - Motor class definition #include #include #include #include using namespace std; class CMotor { public: CMotor(); // Default constructor CMotor(const string & idNum, double voltage ); // Overloaded constructor void ReadFromFile(ifstream & infile); // Read a single motor from a text file // Receives: input file stream, already open // Returns: nothing void WriteToFile( ofstream & outfile ) const; // Write a single motor to a text file // Receives: output file stream, already open // Returns: nothing string get_ID() const; // Returns the motor's ID attribute bool set_ID(const string & newID); // Sets the motor's ID attribute // Receives: newID, which must be digits. // Returns: true if newID was the correct length, // or false if newID was invalid. double get_Voltage() const; // Returns the motor's Voltage attribute void set_Voltage(double v); // Sets the motor's Voltage attribute void Display() const; // Display a motor on the console. void Input(); // Input a motor from the user. enum {ID_SIZE = 7}; // Standard motor ID size private: string m_ID; // the motor identification number double m_voltage; };