第一范文网 - 专业文章范例文档资料分享平台

工资管理系统源代码

来源:用户分享 时间:2025/6/7 4:40:53 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

源代码: (1)

#include #include #include #include

const int EMP=1000;//学院教工总人数(跟据需要可以放缩) void numbertochar(char*,double); //定义基类教工类employee class employee { private:

char name[10],

number[10],post[10],sex[10],telephone[15]; // 性别 电话号码 int age;

double monthwages;

static long employees;//学院教工人数 public:

long getemployees() { return employees; } char*getnumber() { return number; } char*getname() { return name; }

char*getpost()

姓名 教工号职位

https://shop125453798.taobao.com/search.htm?spm=a1z10.5006-c.0.0.DdkCgL&search=y

{

return post; }

char*getsex() { return sex; } char*gettelephone() { return telephone; } int getage()

{ return age; }

double getmonthwages() { return monthwages; }

void setnumber(char temp[]) { renumber:

if(strlen(temp)>15)

{ cout<<\输入错误(不能多余15个字母或5个汉字)!请重新输入。\\n\ char temp1[15];

cout<<\教 工 号:\\t\ cin>>temp1;

if(strlen(temp1)>15) goto renumber; else

strcpy(number,temp1); }

else strcpy(number,temp); }

void setname(char temp[]) {

renumber: if(strlen(temp)>15)

{ cout<<\输入错误(不能多余15个字母或5个汉字)!请重新输入。\\n\ char temp1[10];

cout<<\姓 名:\\t\ cin>>temp1;

if(strlen(temp1)>15) goto renumber;

else strcpy(name,temp1); }

else strcpy(name,temp); employees++; }

void setpost(char temp[]) { renumber:

if(strlen(temp)>10)

{ cout<<\输入错误(不能多余十个字母或五个汉字)!请重新输入。\\n\ char temp1[10];

cout<<\职 位\\t\ cin>>temp1;

if(strlen(temp1)>10) goto renumber;

else strcpy(post,temp1); } else

strcpy(post,temp); }

void setsex() {

cout<<\性别(1、男;2、女):\ resex: char temp1[5]; cin>>temp1;

if(strlen(temp1)==1) { switch(temp1[0]) {

case '1': strcpy(sex,\男\ break;

case '2': strcpy(sex,\女\ break; default:

cout<<\错误(请选择1或2)\ goto resex; }

}

else { cout<<\错误(请选择1或2)\ goto resex; } }

void settelephone(char temp[]) {

retelephone:

if(strlen(temp)>20) {

cout<<\输入错误(不能多余二十个数字)!请重新输入。\\n\ char temp1[20];

cout<<\电 话 号 码:\\t\ cin>>temp1;

搜索更多关于: 工资管理系统源代码 的文档
工资管理系统源代码.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c9pjuh9t1jm38ccg96pc4_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top