统计工资 C++ 课程设计 有高手帮做吗?

来源:百度知道 编辑:UC知道 时间:2024/09/24 22:52:22
1. 统计工资
设计要求:
(1) 使用结构数组设计一个公司职员的数据结构,使用下述的结构定义:
struct employee{
int age;
char name[15];
double salary;
};
(2) 在主函数里构造一个数组company,用来存放职工信息。
(3) 设计update函数,用来对company中指定职员的信息进行更改。要求先按照name查询到相应的职员,然后修改并保存。
(4) 设计一个read函数,用来向company中录入职员信息,并显示结果。
(5) 编写mean函数求平均工资。
应该能对全体职工或大于某一年龄的职工工资求和并计算平均值。
(6) 编写total函数对工资求和。
应该能对全体职工或某一年龄段职工的工资求和
选做:
(1) 从文件中读数据存入数组
(2) 将数组的内容保存至文件

有编程高手吗?帮忙做下,感激不尽

//=================================================
//文件名:Wage.cpp
//文件描述:这个文件描述了公司职员工资统计
//编译环境:C-Free4.1 MingGW32 && Microsoft Visual Studio 2008
//作者:无敌队长(effor)
//完成日期:2008-11-2
//保留所有权利(c)东北大学秦皇岛分校,2008.
//=================================================
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#define OK 1
#define ERROR 0
#define MAX_SIZE 100
using namespace std;
//-------------------------------------------------
typedef int Status;
struct employee
{
int age;
char name[15];
double salary;
};//-----------------------------------------------
void display(employee company[],int N)//展示所有员工作息
{
if(N==0){cout<<"没有任何员工信息;\n";return;}
cout<<"===================="<<endl
<<"姓名 年龄 工资\n";
for(int