Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "personType.h"
- #include <string>
- #include <sstream>
- class studentType : public personType {
- friend ostream& operator<<(ostream&, studentType&);
- friend istream& operator>>(istream&, studentType &);
- protected:
- string department;
- public:
- studenType(int ssn, nameType n, dateType date, string dpt)
- : personType(ssn, n, date, dpt) {
- this->department = dpt;
- }
- string getStudentStringInfo(){
- stringstream ss;
- ss << s.name << " " << s.birthDate << " " << s.SSN << s.department;
- return ss.str();
- }
- };
- ostream& operator<<(ostream& os, studentType& s) {
- os << s.name << " " << s.birthDate << " " << s.SSN << s.department << endl;
- return os;
- }
- istream& operator>>(istream& is, studentType& s) {
- cout << "Please enter the name (first & last), the birth date (MM/DD/YYYY) and the SSN and department:" << endl;
- is >> s.name;
- is >> s.birthDate;
- is >> s.SSN;
- is >> s.department;
- return is;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement