/*fuction:Theinformationoftheemplyee;author:wendy;date:2011-10-15;version:1.0;*/#includeiostream#includecstringclassemployee{private:stringname;//thenameoftheemployee;stringstr_addr;//thestressaddressoftheemployee;stringcity;//thecitywhereemployeelive;stringprovince;//provincewhereemployeebelongto;intpo_number;//thepostnumberofemployee;public:employee();//tointializetheinformationoftheemployee;employee(stringname,stringstr_addr,stringcity,stringprovince,intpo_number);//inputtheinformationoftheemployee;voiddisplay();//inputtheinformationoftheemployee;};employee::employee(){name=\"wendy\";str_addr=\"block2\";city=\"meizhou\";province=\"guangdong\";po_number=514581;}voidemployee::employee(stringname,stringstr_addr,stringcity,stringprovince,intpo_number){this-name=name;this-str_addr=str_addr;this-city=city;this-province=province;this-po_number=po_number;voiddisplay();}voidemployee::display(){cout\"theinformationoftheemployeeisasfollowing:\"endl;cout\"name:\"nameendl;cout\"street:\"str_addrendl;cout\"city:\"cityendl;cout\"province:\"provinceendl;cout\"postnumber:\"po_numberendl;}intmain(){employeep;chara[30],b[30],c[30],d[30];inti;cout\"pleaseinputtheinformationoftheemployee--name,street,city,province,postnumber:\"endl;cinabcdi;employee(a,b,c,d,i);return0;}
|