// Source: "Software Design ...", John A Robinson, Newnes, 2004, page 146. #include using namespace std; class location { protected: char name[20]; // String name; would be safer. float latitude; char ns; float longitude; char ew; public: location() {}; ~location() {}; virtual void load(istream& in) { in >> name >> latitude >> ns >> longitude >> ew; } virtual void save(ostream& out) const { out << name << ' ' << latitude << ' ' << ns << ' ' << longitude << ' ' << ew << '\n'; } const char *getname() const { return(name); } const char *zone() const; };