PAGE / NUMPAGES
用的时候,把注释"delete this line"那行所在的代码删除或修改就OK了.
/*
Microsoft Visual C++ .NET编译通过
by 做他@07.12.29
*/
#include "stdafx.h"
#include "iostream"
#include "string"
#include "list"
#include "cassert"
using namespace std。
/*
编号、姓名、部门、应付工资、保险、税金、实付工资。
其中实付工资由公式计算得到:实付工资=应付工资 - 保险- 税金
*/
struct employee{
string m_num。//编号
string m_name。//姓名
string m_dep。//部门
double m_salary。//应付工资
double m_insurance。//保险
double m_tax。//税金
}。
/*
(1)录入:输入职工数据,其中“实付工资”通过计算得到;
(2)删除:删除指定的职工信息(输入姓名,若找到则删除该信息)
(3) 修改:允许对已经录入的数据重新进行编辑、修改;
(4) 显示:显示全体职工数据;
(5)查询:
a. 输入职工姓名,显示该职工的全部数据;
b. 输入某部门值,显示该部门职工的数据、工资总额、平均工资。
(6) 退出程序。
*/
list emps。
int _tmain(int argc, _TCHAR* argv[])
{
void print(const employee &e)。
void input()。
void del()。
void mod()。
void show_all()。
void show_name()。
void show_dep()。
cout<
cout<
cout<
int choose=0。
cin>>choose。
assert(!cin.fail())。
while (choose!=6)
{
if (choose==1) input()。
if (choose==2) del()。
if (choose==3) mod()。
if (choose==4)
{
int choice=0。
cout<
cin>>choice。
if (choice==1) show_name()。
if (choice==2) show_dep()。
if (choice==3)
{
cout<
cin>>choose。
assert(!cin.fail())。
continue。
}
}
if (choose==5) show_all()。
cout<
cin>>choose。
assert(!cin.fail())。
}
return 0。
}
void print(const employee &e)
{
cout<
cout<
cout<
cout<
cout<
cout<
cout<
}
void input()
{
string num,name,dep。
double salary,ins,tax。
cout<
cin>>num。
cout<
cin>>name。
cout<
cin>>dep。
cout<
cin>>i