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

就是用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 退出系统。

#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; }
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-07-01
晕,被你抢先啦...
第2个回答  2010-07-01
我这正好有一个 稍微改改就可以了!!

//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();
}
第3个回答  2010-07-05
已有的回答都对不上啊,就这样应付人。。。
我不知道是否有空,帮你设计一下
就三个类就可以了:销售员类、文件类和总管理类

C++课程设计 高分悬赏C++课程设计“有理数运算”,满意还有追分!
小写了一下,,放在LINUX里编译并且运行过了。代码如下:include <stdio.h> include <math.h> include <sys\/types.h> class CRationalNum { public:int SetRationalNum(int a, int b);int GetA();int GetB();CRationalNum operator+(CRationalNum &rRationNum);CRationalNum operator-(CRation...

高分悬赏!!!谁会用c++编写一个 排考场座位系统 啊!!!
else if (5 == choose) display_seats(seat);else exit(1);} while( choose );} \/***\/ \/\/选择1,为新来的考生安排座位,方法:用户输入准考证号和姓名,系统随机产生 \/\/---该考生座位的行号和列号,要求做到一个考生只有一个座位,而且在已有考生的位 \/\/---置上不能再安排新的考生;...

C语言编写一个程序,急用!!高分悬赏(正确答案追加分数)
printf("请计算: %d + %d = ", m, n);result = m + n;scanf("%d", &input);if(input != result)printf("真可惜, 回答错误, 请再接再厉!\\n");else printf("恭喜你, 回答正确, 请继续加油!\\n");plu[i][0] = m;plu[i][1] = n;plu[i][2] = input;plu[i][3] = ...

求C++高手帮解:C语言表达式翻译 高分悬赏
中缀式的形式:(a+b)*c-d;转化成后缀式就是:ab+c*d-;意思就是a与b先进行计算,所以就先把a与b这两个操作数现在前面,然后再紧接着先运算符 表达式格式:(a+b)*c-d;其中a、b、c、d就是所说的变量(操作数),*+-就是所说的操作(运算符),()就是所说的小括弧 算术运算:+ ...

高分悬赏 vc++中输入一个单词又让它原样输出。求高手帮助本人才开始学的...
你的程序这样改一下便是了:include<stdio.h> include<string.h>\/\/要加上这个头文件,不然无法处理字符串 void main(){ char Array[100];\/\/假设你最长输入99个字符 scanf("%s",Array);\/\/原来是scanf("%c",&a);注意变化 printf("%s",Array);\/\/这里也有变化,请注意 } ...

...语言用c或者c++,采用栈来实现这个函数。高分悬赏~~
请设计一个有效的算法,可以进行两个n位大整数的乘法运算。设X和Y都是n位的二进制整数,现在要计算它们的乘积XY。我们可以用小学所学的方法来设计一个计算乘积XY的算 法,但是这样做计算步骤太多,显得效率较低。如果将每2个1位数的乘法或加法看作一步运算,那么这种方法要作 O(n2)步运算才能求出...

悬赏分数!高分!!C++
你这个问题我已经答过了,在点击按钮的消息响应函数里下断点,看看有没有被调用,如果没有执行到断点处,说明你这个按钮没有添加小心响应函数,请用MFC提供的宏BEGIN_MESSAGE_MAP & END_MAESSAGE_MAP添加消息映射再试一次。还有,按钮显示出来只能说明你WM_PAINT消息函数被正确处理,按钮被绘制出来了,不...

高分悬赏...vc++发展史
随着C++语言的创建,程序设计的新纪元完全实现了。用一个权威人士的话来说,Stroustrup创建了世界上功能最强大的计算机语言,并且指明了未来语言发展的方向。尽管C++语言的发展刚刚开始,但它已经导致了两种重要语言的出现:Java和C#。除了稍有区别之外,Java和C#的语法、对象模型以及全部的“外观和感受”都非常类似于C++。

请高手帮我写一个vbe整人代码 高分悬赏
这个实际并不难。难点在于删除自己,正在运行的程序windows是不允许删除的。所以,我们做一个“壳”。第一个程序,是真正要运行的程序,但不设立入口(也就是说,本来是exe文件,我们却改成别的),致使无法双击运行。第二个程序只有一个作用,就是cmd命令来运行第一个程序。当第一次运行完成,退出第...

...编程语言一般用什么语言?C\/C++ C# NET ,高分悬赏,追加
1、首先先配置好ironpython VS2015的开发环境,然后打开。2、选择新建项目,这里选择WPF桌面应用程序。3、点击启动,一个简单的桌面应用程序窗口就生成了。4、作为第一个应用程序,现在向窗口拖入一个按钮控件,并调整大小。5、现在来看一下右边的属性。看到这个按钮的名字被叫做button,而它上面的文字被...

相似回答