找传奇、传世资源到传世资源站!

员工信息管理系统

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

员工信息管理
员工信息管理系统 常规C/C++编程-第1张
#include "Chairman.h"
void Chairman::input()
{cout << "请输入主任工程师的信息:" << endl << "职务、部门、专业、职称、编号、姓名、年龄:";
cin >> this->zhiwu >> this->department >> this->major
>>this->zhicheng>> this->number >> this->name >> this->age;
Write(*this);}//提示用户输入信息
void Chairman::write(fstream &m)
{m.open("Chairman.txt", ios::app);
m << "\t" << zhiwu << "\t" << department << "\t" << major << "\t" << zhicheng
<< "\t" << number << "\t" << name << "\t" << age<<endl;
m.close();}//写入文件
void Chairman::read(fstream &n)
{n.open("Chairman.txt", ios::in);
if (!n.is_open())
{cout << "文件打开失败" << endl;
system("pause");
return;}
cout << "主任工程师:"<< "\t职务\t"<<"部门\t"<<"专业\t"
<<"职称\t"<<"编号\t"<<"姓名\t"<<"年龄" << endl;
n >> this->zhicheng >> this->department >> this->major >>
this->zhicheng >> this->number >> this->name >> this->age;
while (!n.eof())
{cout << "\t\t" << this->zhicheng << "\t" << this->department << "\t"
<< this->major << "\t" << this->zhicheng << "\t"
<< this->number << "\t" << this->name << "\t" << this->age << endl;
n >> this->zhicheng >> this->department >> this->major >> this->zhicheng >> this->number >> this->name >> this->age;}
n.close();}//读取文件
void Chairman::display()
{Read(*this);}//输出文件的内容

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复