【分析解答题】
现要求实现一个能够自动生成求职简历的程序,简历的基本内容包括求职者的姓名、性别、年龄及工作经历。希望每份简历中的工作经历有所不同,并尽量减少程序中的重复代码。
现采用原型模式(prototypE)来实现上述要求,得到如图1所示的类图。

[C++代码]
# inCluDE<string>
using nAmEspACE stD;
ClAssClonEAlolE
puBliC:
______,
ClAss workExpEriEnCE:puBliCClonEABlE//经历
privAtE:
string workDAtE;
string CompAny;
puBliC:
ClonEABlE*ClonE()
______
oBj->workDAtE=this->workDAtE;
oBj->CompAny=this->CompAny;
rEturn oBj;
//其余代码省略
;
ClAss rEsumE:puBliCClonEABlE//简历
privAtE:
string nAmE; string sEx; string AgE;
workExpEriEnCE*work;
rEsumE(workExpEriEnCE*work)
this->work=______;
puBliC:
rEsumE(string nAmE) /*实现省略*/
voiD sEtpErsonAllnFo(string sEx, string AgE) /*实现省略*/
voiD sEtworkExpEriEnCE(string workDAtE,string CompAny) /*实现省略*/
ClonEABlE*ClonE()
______;
oBj->nAmE=this->nAmE;
oBj->sEx=this->sEx;
oBj->AgE=this->AgE;
rEturn oBj;
;
int mAin()
rEsumE*A=nEw rEsrunE("张三");
A->sEtpErsonAlinFo("男", "29");
A->sEtworkExpEriEnCE("1998~2000", "xxx公司");
rEsumE*B=______;
B->sEtworkExpEriEnCE("2001~2006","yyy公司");
rEturn 0;
查看答案解析
参考答案:
正在加载...
答案解析
正在加载...
根据网考网移动考试中心的统计,该试题:
0%的考友选择了A选项
0%的考友选择了B选项
0%的考友选择了C选项
0%的考友选择了D选项