| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 820 人关注过本帖
标题:这个错误怎么改哦?急急急!!!!谢谢谢谢
只看楼主 加入收藏
爱学习的
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-4-20
收藏
 问题点数:0 回复次数:2 
这个错误怎么改哦?急急急!!!!谢谢谢谢
请教下下面的程序错误怎么改哦????????????谢谢谢谢了哦

class employee
{
    public:
        employee();
        void promote(int);
        void setyuexin(float);
        int getbianhao();
        int getrgrade();
        int getyuexin();
    protected:
        int gerenbianhao;
        int grade;
        float yuexin;
        static int employeeno;
};
//类实现文件
#include<iostream>
#include"employee.h"
using namespace std;
int employee::employeeno=1000;
employee::employee()                 //构造函数的实现
{
    gerenbianhao=gerenbiaohao++;
    grade=1;
    yuexin=0.0;
}
void employee::promote(int inscrement)
{
    grade=grade+inscrement;
}
void employee::setyuexin(float pa)
{
    yuexin=pa;
}
int employee::getbianhao()
{
    return(employeeno);
}
void employee::getrgrade()
{
    return(grade);
}
int employee::getyuexin()
{
    return(yuexin);
}
//主函数
#include<iostream>
#include"employee.h"
using namespace std;
int main()
{
    employee m1;
    employee t1;
    employee sm1;
    employee s1;
    float pa;
    cout<<"输入月薪:";
    cin>>pa;
    m1.promote(3);
    m1.setyuexin(pa);

    cout<<"输入月薪:";
    cin>>pa;
    t1.promote(2);
    t1.setyuexin(pa);

    cout<<"输入月薪:";
    cin>>pa;
    sm1.promote(3);
    sm1.setyuexin(pa);

    cout<<"输入月薪:";
    cin>>pa;
    s1.setyuexin(pa);

    //显示信息
    cout<<"编号:"<<m1.getbianhao()<<"级别:"<<m1.getrgrade()<<"工资:"<<m1.getyuexin()<<endl;
    cout<<"编号:"<<t1.getbianhao()<<"级别:"<<t1.getrgrade()<<"工资:"<<t1.getyuexin()<<endl;
    cout<<"编号:"<<sm1.getbianhao()<<"级别:"<<sm1.getrgrade()<<"工资:"<<sm1.getyuexin()<<endl;
    cout<<"编号:"<<s1.getbianhao()<<"级别:"<<s1.getrgrade()<<"工资:"<<s1.getyuexin()<<endl;
}
搜索更多相关主题的帖子: int employee float void gerenbianhao 
2008-04-20 22:42
aipb2007
Rank: 8Rank: 8
来 自:CQU
等 级:贵宾
威 望:40
帖 子:2879
专家分:7
注 册:2007-3-18
收藏
得分:0 
错误信息

Fight  to win  or  die...
2008-04-20 23:20
爱学习的
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-4-20
收藏
得分:0 
谢谢谢谢了哦
错误信息是楞个的:
(19) : fatal error C1083: Cannot open include file: 'employee.h': No such file or directory
2008-04-21 15:38
快速回复:这个错误怎么改哦?急急急!!!!谢谢谢谢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023064 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved