数据结构大作业之家谱管理系统(2)

2018-11-19 20:43

else if (n == 8){ s.pop_back(); cout << \; } else{ cout << char(n); s.push_back(char(n)); } } return s; } //与BirthDay相关的函数 istream &operator>>(istream &in, BirthDay &b){//从文件中读取生日的信息 in >> b.year >> b.month >> b.day; return in; } ostream &operator<<(ostream &out, BirthDay &b){ out << b.year << \ << b.month << \ << b.day; return out; } //与Member相关的函数 void Member::setE(){ try{ istringstream sin; cout << setw(20) << \请输入成员信息:\\n\ << endl << setw(20) << \姓名:\; sin.str(gets()); sin >> name; cout << endl << setw(20) << \出生地:\;

sin.str(gets()); sin.clear(); sin >> birthPlace; cout << endl << setw(20) << \生日:\; sin.str(gets()); while (true){ sin.clear(); sin >> birthDay.year >> birthDay.month >> birthDay.day; if ( !sin||birthDay.year > 2014 || birthDay.month > 12 || birthDay.day > 31){ cout << \输入错误,请重新输入:\; sin.str(gets()); } else break; } cout << endl << setw(20) << \性别:\; sin.str(gets()); sin.clear(); while (sin >> sex){ if (sex == \ || sex == \ || sex == \男\ || sex == \女\) break; else{ cout << \性别必须是male、female、男或者女,请重新输入:\; sin.str(gets()); sin.clear(); } } cout << endl << setw(20) << \身高(厘米):\; sin.str(gets()); sin.clear(); while (!(sin >> height)){ cout << \输入错误,请重新输入:\; sin.str(gets()); sin.clear(); } cout << endl << setw(20) << \年龄:\; sin.str(gets()); sin.clear(); while (!(sin >> age) || age > 300){ cout << \输入错误,请重新输入:\ << endl; sin.str(gets()); sin.clear(); } cout << endl << setw(20) << \学历:\;

sin.str(gets()); sin.clear(); sin >> education; cout << endl << setw(20) << \工作:\; sin.str(gets()); sin.clear(); sin >> job; cout << endl << setw(20) << \父亲:\; sin.str(gets()); sin.clear(); sin >> father; } catch (int ex){ throw ex; } return; } ostream &operator<<(ostream &out, const Member

&m){ out << endl << setw(25) << \该成员信息如下:\ << endl <>(istream &in, Member &m){ in >> m.name >> m.birthPlace >> m.birthDay >> m.sex >> m.height >> m.age >> m.education >> m.job >> m.father; return in; } //FamilySystem的成员函数 int FamilySystem::menu(){ cout << \; cout << \---------------------------\\n\; cout << \|\\n\; cout << \系统菜单 |\\n\; cout << \|\\n\; cout << \查询成员 |\\n\; cout << \|\\n\; cout << \查询家庭整体情况 |\\n\; cout << \|\\n\; cout << \添加成员 |\\n\; cout << \|\\n\; cout << \删除


数据结构大作业之家谱管理系统(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:入户门制安工程招标文件

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: