请C++的高手帮我设计一下这个程序,绝对高分悬赏!! 100

就是用C++编程出一个销售管理的系统,希望高手能给我提供一些帮助,就算是一小点也没关系,绝对高分悬赏!!具体要求如下:1销售员信息:每个销售员包括姓名,编号,产品1销售额... 就是用C++编程出一个销售管理的系统,希望高手能给我提供一些帮助,就算是一小点也没关系,绝对高分悬赏!!
具体要求如下:

1 销售员信息:每个销售员包括姓名,编号,产品1销售额,产品2销售额,总销售额共5项信息。首先输入3个销售员的信息存入文件“sailer.dat”中。
2 排序:按产品1的销售额进行排序,将排序后的信息存入文件“sailer1.dat”中,按产品2的销售额进行排序,将排序后的信息存入文件“sailer2.dat”中,按总销售额进行排序,将排序后的信息存入文件“sailer3.dat”中。
3 统计:分别统计产品1的总销售额和产品2的总销售额并进行输出。
4 销售员的增加:增加一个销售员的信息,先将其添加到文件“sailer.dat”中,然后按其总销售额进行插入排序,排序后的信息仍存入文件“sailer3.dat”中。
5 销售员的减少:输入一个销售员的姓名,从文件“sailer.dat”中将其删除。
6 输出全部销售员的信息。
7 退出系统。
展开
 我来答
养生内经
2010-07-01 · TA获得超过1115个赞
知道大有可为答主
回答量:864
采纳率:60%
帮助的人:651万
展开全部
#include <iostream>
#include <string>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <conio.h>
using namespace std;

//仓库管理员类
class admin
{
public:
admin();
private:
string name;
};

//仓库货架类
class shelf
{
public:
shelf();
private:
admin men;//管理员
string storeNo;//仓库编号
string kinds;//商品大类
string shelfNo;//货架号
};

//electrical class
class ele
{
public:
ele();
private:
string name;//商品名
double price;//介格
shelf sh;//所属货架
long count;//商品数量
};

//管理(组合类)
class mana
{
public:
mana();
char first_face();//首页
void in_storage();//入库
void out_storage();// 出库
void select_ele();//查询
void select_name();//按商品名称查询
void select_price();//按商品价格查询
void select_kind();//按大类查询
void call_break();//商品报损
private:
ele aele;
shelf ashelf;
admin abs;
};
//电器类默认构造函数
ele::ele():sh()
{
name = "xxx";//商品名
price = 0.0;//介格
count = 0;//商品数量
}

//

//仓库货架类默认构造函数
shelf::shelf():men()
{
storeNo = "xxx";//仓库编号
kinds = "xxx";//商品大类
shelfNo = "xxx";;//货架号
}

//仓库管理员类
admin::admin()
{
name = "xxx";
}

//管理类默认构造函数
mana::mana():aele(), ashelf(), abs()
{
}

char mana::first_face()
{
system("cls");
cout << endl;
cout <<endl <<"\t\t◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆"
<<endl <<"\t\t◆ ◆"
<<endl <<"\t\t◆ 商场电器库存管理系统 ◆"
<<endl <<"\t\t◆ ◆"
<<endl <<"\t\t◆ 1. 商品入库 ◆"
<<endl <<"\t\t◆ ◆"
<<endl <<"\t\t◆ 2. 商品出库 ◆"
<<endl <<"\t\t◆ ◆"
<<endl <<"\t\t◆ 3. 查询统计 ◆"
<<endl <<"\t\t◆ ◆"
<<endl <<"\t\t◆ 4. 商品报损 ◆"
<<endl <<"\t\t◆ ◆"
<<endl <<"\t\t◆ 5. 退出系统 ◆"
<<endl <<"\t\t◆ ◆"
<<endl <<"\t\t◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆" <<endl <<endl <<"\t\t";

return getch();
}

//入库
void mana::in_storage()
{
system("cls");
string name;//商品名
double price;//介格
string storeNo;//仓库编号
string kinds;//商品大类
string shelfNo;//货架号
long count = 0; //商品数量

cout << endl << "商品入库,请输入相关信息 : " << endl << endl ;
cout << "\t商品名称 : ";
cin >> name;
cout << endl << "\t商品介格 : ";
cin >> price;
cout << endl << "\t商品数量 : ";
cin >> count;
cout << endl << "\t仓库编号 : ";
cin >> storeNo;
cout << endl << "\t商品大类 : ";
cin >> kinds;
cout << endl << "\t货架编号 : " ;
cin >> shelfNo;

ofstream storeFile("store.txt", ios::app);
storeFile << setiosflags(ios::left) << setw(20) << name << " "
<< setw(15) << price << " " << setw(10) << count << " "
<< setw(10) << storeNo << " " << setw(20) << kinds << " "
<< shelfNo << endl;
storeFile.close();

cout << endl << endl << "\t该商品已经入库......." << endl << endl << "\t";
system("pause");
}

// 出库
void mana::out_storage()
{
system("cls");

string name;//商品名

cout << endl << "\t商品出库,输入出库商品信息 : " << endl << endl;
cout << "\t商品名称 : ";
cin >> name;

ifstream storeFile("store.txt");
if (!storeFile)
{
ofstream storeFile1("store.txt");
storeFile1.close();
cout << endl << endl << "\t仓存为空!!!!" << endl << endl << "\t";
system("pause");
return;
}
bool flag = false;
string name1;//商品名
double price1;//介格
string storeNo1;//仓库编号
string kinds1;//商品大类
string shelfNo1;//货架号
long count1 = 0; //商品数量

ofstream tempFile("temp.txt");

while (storeFile >> name1 >> price1 >> count1 >> storeNo1 >> kinds1 >> shelfNo1)
{
if (name1==name)
flag = true;
else
{
tempFile << setiosflags(ios::left) << setw(20) << name1 << " "
<< setw(15) << price1 << " " << setw(10) << count1 << " "
<< setw(10) << storeNo1 << " " << setw(20) << kinds1 << " "
<< shelfNo1 << endl;
}
}
tempFile.close();
storeFile.close();

if (!flag)
{
cout << endl << endl << "\t仓库中没有这种商品!!!" << endl << endl << "\t";
system("pause");
return;
}

ofstream storeFile1("store.txt");
ifstream tempFile1("temp.txt");
storeFile1 << tempFile1.rdbuf();
storeFile1.close();
tempFile1.close();

cout << endl << "\t这些商品已经出库, 请仔细检查!!!" << endl << endl << "\t";
system("pause");
}

//查询
void mana::select_ele()
{
while (1)
{
system("cls");

cout << endl << endl;
cout << "\t=============================================================" << endl
<< "\t|| ||" << endl
<< "\t|| 商 品 查 询 ||" << endl
<< "\t|| ||" << endl
<< "\t|| 1. 按商品名称查询 ||" << endl
<< "\t|| ||" << endl
<< "\t|| 2. 按商品价格查询 ||" << endl
<< "\t|| ||" << endl
<< "\t|| 3. 按大类查询 ||" << endl
<< "\t|| ||" << endl
<< "\t|| 4. 返回 ||" << endl
<< "\t|| ||" << endl
<< "\t=============================================================" << endl << endl << "\t\t";
char select = getch();

switch (select)
{
case '1':
select_name();
break;
case '2':
select_price();
break;
case '3':
select_kind();
break;
case '4':
return;
default:
break;
}
}
}

//按商品名称查询
void mana::select_name()
{
system("cls");
cout << endl << "\t按商品名查询 : " << endl << endl ;
cout << "\t输入商品名 : ";
string name;
cin >> name;

string name1;//商品名
double price1;//介格
string storeNo1;//仓库编号
string kinds1;//商品大类
string shelfNo1;//货架号
long count1 = 0; //商品数量

ifstream storeFile("store.txt");
if (!storeFile)
{
cout << endl << endl << "\t对不起,你的库存为空!!!" << endl << endl << "\t";
system("pause");
return;
}

bool flag = false;
cout << endl << "商品名 " << "介格 " << "商品数量 " << "仓库编号 "
<< "商品大类 " << "货架号" << endl << endl;
while (storeFile >> name1 >> price1 >> count1 >> storeNo1 >> kinds1 >> shelfNo1)
{
if (name1 == name)
{
flag = true;
cout << setiosflags(ios::left) << setw(15) << name1 << " "
<< setw(10) << price1 << " " << setw(10) << count1 << " "
<< setw(10) << storeNo1 << " " << setw(15) << kinds1 << " "
<< shelfNo1 << endl;
}
}
storeFile.close();

if (!flag)
cout << endl << endl << "对不起,库存中没有这种商品!!!";
cout << endl << endl;
system("pause");
}

//按商品价格查询
void mana::select_price()
{
system("cls");
cout << endl << "\t按商品价格查询 : " << endl << endl ;
cout << "\t输入价格 : ";
double price;
cin >> price;

string name1;//商品名
double price1;//介格
string storeNo1;//仓库编号
string kinds1;//商品大类
string shelfNo1;//货架号
long count1 = 0; //商品数量

ifstream storeFile("store.txt");
if (!storeFile)
{
cout << endl << endl << "\t对不起,你的库存为空!!!" << endl << endl << "\t";
system("pause");
return;
}

bool flag = false;
cout << endl << "商品名 " << "介格 " << "商品数量 " << "仓库编号 "
<< "商品大类 " << "货架号" << endl << endl;
while (storeFile >> name1 >> price1 >> count1 >> storeNo1 >> kinds1 >> shelfNo1)
{
if (price1 == price)
{
flag = true;
cout << setiosflags(ios::left) << setw(15) << name1 << " "
<< setw(10) << price1 << " " << setw(10) << count1 << " "
<< setw(10) << storeNo1 << " " << setw(15) << kinds1 << " "
<< shelfNo1 << endl;
}
}
storeFile.close();

if (!flag)
cout << endl << endl << "对不起,库存中没有这个价格的商品!!!";
cout << endl << endl;
system("pause");
}

//按大类查询
void mana::select_kind()
{
system("cls");
cout << endl << "\t按商品大类查询 : " << endl << endl ;
cout << "\t输入大类名 : ";
string kinds;
cin >> kinds;

string name1;//商品名
double price1;//介格
string storeNo1;//仓库编号
string kinds1;//商品大类
string shelfNo1;//货架号
long count1 = 0; //商品数量

ifstream storeFile("store.txt");
if (!storeFile)
{
cout << endl << endl << "\t对不起,你的库存为空!!!" << endl << endl << "\t";
system("pause");
return;
}

bool flag = false;
cout << endl << "商品名 " << "介格 " << "商品数量 " << "仓库编号 "
<< "商品大类 " << "货架号" << endl << endl;
while (storeFile >> name1 >> price1 >> count1 >> storeNo1 >> kinds1 >> shelfNo1)
{
if (kinds1 == kinds)
{
flag = true;
cout << setiosflags(ios::left) << setw(15) << name1 << " "
<< setw(10) << price1 << " " << setw(10) << count1 << " "
<< setw(10) << storeNo1 << " " << setw(15) << kinds1 << " "
<< shelfNo1 << endl;
}
}
storeFile.close();

if (!flag)
cout << endl << endl << "对不起,库存中没有这类商品!!!";
cout << endl << endl;
system("pause");
}

//商品报损
void mana::call_break()
{
system("cls");

string name;//商品名

cout << endl << "\t商品报损,请输入要报损商品信息 : " << endl << endl;
cout << "\t商品名称 : ";
cin >> name;

ifstream storeFile("store.txt");
if (!storeFile)
{
ofstream storeFile1("store.txt");
storeFile1.close();
cout << endl << endl << "\t仓存为空!!!!" << endl << endl << "\t";
system("pause");
return;
}

bool flag = false;
string name1;//商品名
double price1;//介格
string storeNo1;//仓库编号
string kinds1;//商品大类
string shelfNo1;//货架号
long count1 = 0; //商品数量

ofstream tempFile("temp.txt");
cout << endl << endl << "你想报损商品信息如下 : " << endl << endl;
cout << endl << "商品名 " << "介格 " << "商品数量 " << "仓库编号 "
<< "商品大类 " << "货架号" << endl << endl;
while (storeFile >> name1 >> price1 >> count1 >> storeNo1 >> kinds1 >> shelfNo1)
{
if (name1==name)
{
flag = true;
cout << setiosflags(ios::left) << setw(15) << name1 << " "
<< setw(10) << price1 << " " << setw(10) << count1 << " "
<< setw(10) << storeNo1 << " " << setw(15) << kinds1 << " "
<< shelfNo1 << endl;
shelfNo1 += "(损坏)";
}
tempFile << setiosflags(ios::left) << setw(20) << name1 << " "
<< setw(15) << price1 << " " << setw(10) << count1 << " "
<< setw(10) << storeNo1 << " " << setw(20) << kinds1 << " "
<< shelfNo1 << endl;
}
tempFile.close();
storeFile.close();

if (!flag)
{
cout << endl << endl << "对不起,仓库中没有这种商品!!!" << endl << endl;
system("pause");
return;
}
ofstream storeFile1("store.txt");
ifstream tempFile1("temp.txt");
storeFile1 << tempFile1.rdbuf();
storeFile1.close();
tempFile1.close();

cout << endl << endl << "这些商品已经损坏,请尽快从仓库中取出!!!" << endl << endl;
cout << "报损成功,记录已经更改!!!" << endl << endl ;

system("pause");
}
int main()
{
char select;
mana men;

while (select = men.first_face())
{
switch (select)
{
case '1':
men.in_storage();
break;
case '2':
men.out_storage();
break;
case '3':
men.select_ele();
break;
case '4':
men.call_break();
break;
case '5':
cout << "\t" << "谢谢使用!!!!" << endl << endl << "\t\t";
exit( 0 );
break;
default:
break;
}
}
return 0; }
平优
2010-07-01 · TA获得超过175个赞
知道答主
回答量:45
采纳率:0%
帮助的人:22.5万
展开全部
晕,被你抢先啦...
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
素净还旺盛的小板栗a
2010-07-01 · TA获得超过249个赞
知道答主
回答量:135
采纳率:0%
帮助的人:94.1万
展开全部
我这正好有一个 稍微改改就可以了!!

//gongzi.cpp
#include <iostream.h>
#include <string.h>
#include <fstream.h>
#include "H1.H"
//using namespace std;
#define N 30 //人员的总数
char filename[]="system.txt";
people::people(int no1,char *name1,int age1,double salary1,double workyear1)
{
no=no1;
strcpy(name,name1);
age=age1;
salary=salary1;
workyear=workyear1;
}
int people::getno()
{
return no;
}
char *people::getname()
{
return name;
}
int people::getage()
{
return age;
}
double people::getsalary()
{
return salary;
}
double people::getworkyear()
{
return workyear;
}
void people::input()
{
cout<<"\t\t 名字:";
cin>>name;
cout<<"\t\t 编号:";
cin>>no;
cout<<"\t\t 年龄:";
cin>>age;
cout<<"\t\t 工龄:";
cin>>workyear;
}
void people::output()
{
cout<<"\t\t 人员编号:"<<no<<endl;
cout<<"\t\t 姓名:"<<name<<endl;
cout<<"\t\t 年龄:"<<age<<endl;
cout<<"\t\t 工龄:"<<workyear<<endl;

}
manager::manager(int no1,char *name1,int age1,double salary1,double workyear1,double allowance1):
people(no1,name1, age1, salary1, workyear1)
{
allowance=allowance1;
}
void manager::input()
{
people::input();
cout<<"\t\t 每月津贴:";
cin>>allowance;
}
double manager::computesalary()
{
salary=salary+allowance+workyear*50;//行政人员的工资:基本工资+每月津贴
//+工龄*每年50
}
void manager::output()
{
people::output();
cout<<"\t\t 每月津贴:"<<allowance;
// cout<<"\t\t 行政人员工资:"<<b[s].outsalary()<<endl<<endl;

}

//教师
teacher::teacher(int no1,char *name1,int age1,double salary1,double workyear1,double classes1):
people(no1,name1,age1,salary1,workyear1)
{
classes=classes1;
}

void teacher::input()
{
people::input();
cout<<"\t\t 上课课时:";
cin>>classes;
}
double teacher::computesalary()
{
salary=salary+classes*30+workyear*50;//教师工资:基本工资+上课课时*每节课30块钱
//+工龄*每年50
}
void teacher::output()
{
people::output();
cout<<"\t\t 上课课时:";
cin>>classes;
// cout<<"\t\t 教师工资:"<<c[s].outsalary()<<endl<<endl;
}

//实验人员
laber::laber(int no1,char *name1,int age1,
double salary1,double workyear1,double allowance1,double classes1):
people( no1,name1, age1, salary1, workyear1)
{
allowance=allowance1;
classes=classes1;
}
void laber::input()
{
people::input();
cout<<"\t\t 每月津贴:";
cin>>allowance;
cout<<"\t\t 上课课时:";
cin>>classes;
}
double laber::computesalary()
{
salary=salary+allowance+classes*15+workyear*50;//实验员工资:基本工资+津贴+课时*每节课15
//+工龄*每年50
}
void laber::output()
{
people::output();
cout<<"\t\t 每月津贴:"<<allowance<<endl;
cout<<"\t\t 上课课时:"<<classes<<endl;
// cout<<"\t\t 实验人员工资:"<<d[s].outsalary()<<endl;
}

//后勤人员
logistic::logistic(int no1,char *name1,int age1,double salary1,double workyear1,double workhour1):
people( no1,name1, age1, salary1, workyear1)
{
workhour=workhour1;
}
void logistic::input()
{
people::input();
cout<<"\t\t 工作小时数:";
cin>>workhour;
}
double logistic::computesalary()
{
salary=salary+(workhour-100)*20+workyear*50;//后勤人员:基本工资+工作小时*每小时20
//+工龄*每年50
}
void logistic::output()
{
people::output();
cout<<"\t\t 工作小时数:"<<workhour<<endl;
// cout<<"\t\t 工资:"<<e[s].outsalary()<<endl;
}
//外聘人员
invitor::invitor(int no1,char *name1,int age1,double salary1,double workyear1,double classes1):
people(no1,name1,age1,salary1,workyear1)
{
classes=classes1;
}
void invitor::input()
{
people::input();
cout<<"\t\t 上课课时:";
cin>>classes;
}
double invitor::computesalary()
{
salary=salary+classes*60;//外聘人员工资:基本工资+上课课时*60
}
void invitor::output()
{
people::output();
cout<<"\t\t 上课课时:"<<classes<<endl;
// cout<<"\t\t 外聘人员工资:"<<f[s].outsalary()<<endl;
}

//system
int system::j1=0;
int system::j2=0;
int system::j3=0;
int system::j4=0;
int system::j5=0;
system::system()
{
save();
}
void system::interface1()
{
cout<<"\n\n\n";
cout<<"\t\t********************学校工资管理系统******************"<<endl;
cout<<"\t\t********************高校人员分类***********************"<<endl;
cout<<"\t\t 1.行政人员 "<<endl;
cout<<"\t\t 2.教师 "<<endl;
cout<<"\t\t 3.实验人员 "<<endl;
cout<<"\t\t 4.后勤人员 "<<endl;
cout<<"\t\t 5.外聘人员 "<<endl;
cout<<"\t\t 6.退出系统 "<<endl;
cout<<"\t\t 请选择你要查询的人员类别:1——6 ";
}
void system::addinformation()
{
int n;
int again=1;
char t;
while (again)
{
interface1();
cin>>n;
switch(n)
{
case 1:
infor1();
break;
case 2:
infor2();
break;
case 3:
infor3();
break;
case 4:
infor4();
break;
case 5:
infor5();
break;
case 6:
Interface();
break;
default:
cout<<"\t\t\t 没有此类人员! "<<endl;
continue;
}
cout<<"\t\t\t 信息存储成功!"<<endl;
cout<<"\t\t\t 是否继续输入(y/n)?";
cin>>t;
cout<<endl;
if(!(t=='y'||t=='Y'))
again=0;
}
Interface();
}

void system::infor1()//行政人员
{
manager a;
fstream datafile(filename,ios::in|ios::out|ios::binary);
datafile.seekp(0,ios::end);//写指针到文件尾部
a.input();
datafile.write((char*)&a,sizeof(class manager));
b[j1]=a;
datafile.close();
}
void system::infor2()//教师
{
teacher a;
fstream datafile(filename,ios::in|ios::out|ios::binary);
datafile.seekp(0,ios::end);
a.input();
datafile.write((char*)&a,sizeof(class teacher));
c[j2]=a;
datafile.close();
}

void system::infor3()//实验人员
{
teacher a;
fstream datafile(filename,ios::in|ios::out|ios::binary);
datafile.seekp(0,ios::end);
a.input();
datafile.write((char*)&a,sizeof(class laber));
// d[j3]=a;
datafile.close();
}
void system::infor4()//后勤人员
{
teacher a;
fstream datafile(filename,ios::in|ios::out|ios::binary);
datafile.seekp(0,ios::end);
a.input();
datafile.write((char*)&a,sizeof(class logistic));
// e[j4]=a;
datafile.close();
}
void system::infor5()//外聘人员
{
teacher a;
fstream datafile(filename,ios::in|ios::out|ios::binary);
datafile.seekp(0,ios::end);
a.input();
datafile.write((char*)&a,sizeof(class invitor));
// f[j5]=a;
datafile.close();
}
void system::save()//save 读入数据信息
{
// int i,j;
int n;
fstream datafile(filename,ios::out|ios::in|ios::binary);
datafile.read((char*)&a,sizeof( people));
while(!datafile.eof())
{
n=a.getno();
switch(n)
{
case 1:
{
datafile.seekp(-1*sizeof(class people),ios::cur);
datafile.read((char *)&b[j1],sizeof(manager));
j1++;
break;
}
case 2:
{
datafile.seekp(-1*sizeof(class people),ios::cur);
datafile.read((char *)&c[j2],sizeof(teacher));
j2++;
break;
}
case 3:
{
datafile.seekp(-1*sizeof(class people),ios::cur);
datafile.read((char *)&d[j3],sizeof(laber));
j3++;
break;
}
case 4:
{
datafile.seekp(-1*sizeof(class people),ios::cur);
datafile.read((char *)&e[j4],sizeof(logistic));
j4++;
break;
}
case 5:
{
datafile.seekp(-1*sizeof(class people),ios::cur);
datafile.read((char *)&f[j5],sizeof(invitor));
j5++;
break;
}
default:
break;
}
datafile.read((char *)&a,sizeof(people));
}
datafile.close ();
}
void search1(int h,char ch[20])
{
int s=0,found=0;
switch(h)
{
case 1:
while(s<N)
{
if(strcmp(ch,b[s].getname())==0)
{
b[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 2:
while(s<N)
{
if(strcmp(ch,c[s].getname())==0)
{
c[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 3:
while(s<N)
{
if(strcmp(ch,d[s].getname())==0)
{
d[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 4:
while(s<N)
{
if(strcmp(ch,e[s].getname())==0)
{
e[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 5:
while(s<N)
{
if(strcmp(ch,f[s].getname())==0)
{
f[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
}
if(found==0)
cout<<"\t\t\t 对不起,该人员类别中没有您所要找的人!"<<endl;
}
void search2(int h,int no1)
{
int s=0,found=0;
switch(h)
{
case 1:
while(s<N)
{
if(no1==b[s].getno())
{
b[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 2:
while(s<N)
{
if(no1==c[s].getno())
{
c[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 3:
while(s<N)
{
if(no1==d[s].getno())
{
d[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 4:
while(s<N)
{
if(no1==e[s].getno())
{
e[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
case 5:
while(s<N)
{
if(no1==f[s].getno())
{
f[s].output();
cout<<"\t\t\t**********************"<<endl;
found=1;
}
s++;
}
break;
}
if(found==0)
cout<<"\t\t\t 对不起,该人员类别中没有您所要找的人!"<<endl;
}

void system::search()//查询
{
int n;
char name[20];
int again=1;
char t;
int no;
while(again)
{
interface1();

cout<<"\t\t **************************"<<endl;
cout<<"\t\t 1.按姓名查询 "<<endl;
cout<<"\t\t 2.按编号查询 "<<endl;
cout<<"\t\t **************************"<<endl;
cin>>n;
switch(n)
{
case 1:
{ cout<<"\t\t 请输入您要查找的人员姓名:";
cin>>name;
search1(h,name);
break;
}
case 2:
{
cout<<"\t\t 请输入您要查找的人员工作证号:";
cin>>no;
search2(h,no);
break;
}
default:
cout<<"\t\t 请选择正确的查询方式:";
}
cout<<"\t\t\t 是否继续查询(y/n)?";
cin>>t;
cout<<endl;
if(!(t=='Y'||t=='y'))
again=0;
}
Interface();
}

void outsalary1(int h,char *name)
{
int s=0,found=0;
float salary;
switch(h)
{

case 1:
while(s<N)
{
if(strcmp(name,b[s].getname())==0)
{
b[s].computesalary();
salary=b[s].compute();
found=1;
}
s++;
}
break;
case 2:
while(s<N)
{
if(strcmp(name,c[s].getname())==0)
{
c[s].computesalary();
salary=c[s].compute();
found=1;
}
s++;
}
break;
case 3:
while(s<N)
{
if(strcmp(name,d[s].getname())==0)
{
d[s].computesalary();
salary=d[s].compute();
found=1;
}
s++;
}
break;
case 4:
while(s<N)
{
if(strcmp(name,e[s].getname())==0)
{
e[s].computesalary();
salary=e[s].compute();
found=1;
}
s++;
}
break;
case 5:
while(s<N)
{
if(strcmp(name,f[s].getname())==0)
{
f[s].computesalary();
salary=f[s].compute();
found=1;
}
s++;
}
break;
}
if(found==0)
cout<<"\t\t\t 对不起,该人员中没有您要找的人!"<<endl;
else
{
cout<<"\t\t 姓名:"<<name<<endl;
cout<<"\t\t 工资:"<<salary<<endl;
cout<<"\t\t *******************"<<endl;
}
}
void outsalary()//计算并显示总工资
{
int n;
char name[20];
int again=1;
char t;
while(again)
{
interface1();
cout<<"\n\t\t 请输入所要查看工资的人员类别:";
cin>>n;
cout<<"\n\t\t 请输入所要查看工资的人员姓名:";
cin>>name;
outsalary1(n,name);
cout<<"\t\t\t 是否继续查看利润(y/n)?";
cin>>t;
cout<<endl;
if(!(t=='y'||t=='Y'))
again=0;
}
Interface();
}

void system::Interface()//界面
{
int n;
cout<<"\n\n\n\n\n\n\n";
cout<<"\t\t *****************欢迎使用";
cout<<"*****************"<<endl;
cout<<"\t\t **********高校工资管理系统";
cout<<"**********"<<endl;
cout<<"\t\t 1.输入信息 "<<endl;
cout<<"\t\t 2.查询信息并显示 "<<endl;
cout<<"\t\t 3.计算工资并显示 "<<endl;
cout<<"\t\t 4.退出 "<<endl;
cout<<"\t\t 请您选择(1——4): ";
cin>>n;
switch(n)
{
case 1:
addinformation();
break;
case 2:
search();
break;
case 3:
outsalary();
break;
case 4:
break;
}
}
// main.cpp

void main()
{
system s;
s.Interface();
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
chenmgdmc
2010-07-05
知道答主
回答量:6
采纳率:0%
帮助的人:2.4万
展开全部
已有的回答都对不上啊,就这样应付人。。。
我不知道是否有空,帮你设计一下
就三个类就可以了:销售员类、文件类和总管理类
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式