📄 main.cpp
字号:
#include"indent.h"
void customer();
void postmember();
void creatmagazineindent();
void creatnewspaperindent();
void main()
{
char letter;
cout<<"******************************************************************"<<endl
<<"******************欢迎使用邮局信息管理系统!***********************"<<endl
<<"************************5010139006********************************"<<endl
<<"*************************崔海洋***********************************"<<endl
<<"*************************F0101301*********************************"<<endl
<<"*********************船舶与海洋工程学院**************************"<<endl
<<"****************************************************************"<<endl
<<"**********退出本系统, 输入q键***********************************"<<endl
<<"**********您要接收客户服务,请输入a键***************************"<<endl
<<"**********您要进行内务管理或是原始数据管理,请输入b键***********"<<endl;
cin>>letter;
switch (letter)
{
case'a':customer();
break;
case'b':postmember();
break;
case'q': break;
default:cout<<"输入键值不正确,请再进行选择:";
break;
}
}
//........
void newspaperlook();
void magazinelook();
void customer()
{
char x;
do{
cout<<"*****************************************************"<<endl
<<" *"<<endl
<<"**********您要查阅报刊信息,请输入a键****************"<<endl
<<"**********您要查阅杂志信息,请输入b键****************"<<endl
<<"**********您要订阅报刊,请输入c键********************"<<endl
<<"**********您要订阅杂志,请输入d键********************"<<endl
<<"**********您要查阅报刊订单信息,请输入e键************"<<endl
<<"**********您要查阅杂志订单信息,请输入f键************"<<endl
<<"* *"<<endl
<<"*****************************************************"<<endl;
char letter;
cin>>letter;
switch (letter)
{
case'a':newspaperlook(); cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'b':magazinelook();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'c':creatnewspaperindent();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'd':creatmagazineindent();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'e':searchnewspaperindent();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'f':searchmagazineindent();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
default:cout<<"输入数据不正确,是否再进行选择?(y/n):";
cin>>x;
}
}while(x=='y'||x=='Y');
}
//..............
void newspaperlook()
{char x;
do{
cout<<"*****************************************************"<<endl
<<" *"<<endl
<<"**********您要按报刊号查阅报刊信息,请输入a键****************"<<endl
<<"**********您要查阅所有报刊信息,请输入b键****************"<<endl
<<"* *"<<endl
<<"*****************************************************"<<endl;
char letter;
cin>>letter;
switch (letter)
{
case'a':searchnewspaper(); cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'b':newspaperlookall();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
default:cout<<"输入数据不正确,是否再进行选择?(y/n):";
cin>>x;
}
}while(x=='y'||x=='Y');
}
//..............
//................
void magazinelook()
{char x;
do{
cout<<"*****************************************************"<<endl
<<" *"<<endl
<<"**********您要按杂志号查阅报刊信息,请输入a键****************"<<endl
<<"**********您要查阅所有杂志信息,请输入b键****************"<<endl
<<"* *"<<endl
<<"*****************************************************"<<endl;
char letter;
cin>>letter;
switch (letter)
{
case'a':searchmagazine(); cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'b':magazinelookall();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
default:cout<<"输入数据不正确,是否再进行选择?(y/n):";
cin>>x;
}
}while(x=='y'||x=='Y');
}
//.....................
//....................
void internal();
void initialdata();
void postmember(){
char x;
do{
cout<<"************************************************"<<endl
<<"**********您要进行内务管理,请输入a键***********"<<endl
<<"**********您要进行原始数据管理,请输入b键*******"<<endl;
char letter;
cin>>letter;
switch (letter)
{
case'a':internal(); cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'b':initialdata();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
default:cout<<"输入数据不正确,是否再进行选择?(y/n):";
cin>>x;
}
}while(x=='y'||x=='Y');
}
//........................
//......................
void indentmagage();
void internal()
{ char x;
do{
cout<<"******************************************************************"<<endl
<<"**********您要进行订单管理,请输入a键*****************************"<<endl
<<"**********您要进行投递管理,请输入b键*****************************"<<endl
<<"**********您要进行报费管理,请输入c键*****************************"<<endl;
char letter;
cin>>letter;
switch (letter)
{
case'a':indentmagage(); cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'b':creatmagazine();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'c':newspaperlook();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'd':magazinelook();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'e':creatoffice();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
default:cout<<"输入数据不正确,是否再进行选择?(y/n):";
cin>>x;
}
}while(x=='y'||x=='Y');
}
//
void newpaperindentdiplayall();
void magazineindentdiplayall();
void officenewspaperfind();
void indentmagage()
{ char x;
do{
cout<<"**************************************************************************"<<endl
<<"**********您要进行显示所有报刊订单,请输入a键*****************************"<<endl
<<"**********您要进行显示所有杂志订单,请输入b键*****************************"<<endl
<<"**********您要进行按出版社统计报刊订单,请输入c键*****************************"<<endl
<<"**********您要进行报费管理,请输入c键*************************************"<<endl;
char letter;
cin>>letter;
switch (letter)
{
case'a':newpaperindentdiplayall(); cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'b':magazineindentdiplayall();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'c':newpaperindentdiplayall();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'd':magazinelook();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
default:cout<<"输入数据不正确,是否再进行选择?(y/n):";
cin>>x;
}
}while(x=='y'||x=='Y');
}
//
void newpaperindentdiplayall()
{
ifstream fin("Newspaper_indent.txt");
char pName[40];
char pAddress[60];
char pTeleno[12];
char pmagazinecode[10];
int pPostcode;
int ppiece;
int startmonth;
int pterm;
newspaper_indent *ps;
int i=0;
fin>>pName>>pAddress>>pTeleno>>pmagazinecode>>pPostcode>>ppiece>>startmonth>>pterm;
while(!fin.eof())
{
ps=new newspaper_indent(pName,pAddress,pTeleno,
pmagazinecode,pPostcode,ppiece,
startmonth,pterm);
ps->Display();
cout<<endl<<endl<<endl;
ps=0;
fin>>pName>>pAddress>>pTeleno>>pmagazinecode>>pPostcode>>ppiece>>startmonth>>pterm;
}
}
//..............................
void magazineindentdiplayall()
{
ifstream fin("Magazine_indent.txt");
char pName[40];
char pAddress[60];
char pTeleno[12];
char pmagazinecode[10];
int pPostcode;
int ppiece;
int startmonth;
int pterm;
magazine_indent *ps;
int i=0;
fin>>pName>>pAddress>>pTeleno>>pmagazinecode>>pPostcode>>ppiece>>startmonth>>pterm;
while(!fin.eof())
{
ps=new magazine_indent(pName,pAddress,pTeleno,
pmagazinecode,pPostcode,ppiece,
startmonth,pterm);
ps->Display();
cout<<endl<<endl<<endl;
ps=0;
fin>>pName>>pAddress>>pTeleno>>pmagazinecode>>pPostcode>>ppiece>>startmonth>>pterm;
}
}
//........................
//........................
//.............................
void initialdata()
{ char x;
do{
cout<<"******************************************************************"<<endl
<<"**********您要进行报刊数据库的创建或追加,请输入a键***************"<<endl
<<"**********您要进行杂志数据库的创建或追加,请输入b键***************"<<endl
<<"**********您要进行报刊数据库的查询, 请输入c键***************"<<endl
<<"**********您要进行杂志数据库的查询, 请输入d键***************"<<endl
<<"**********您要进行报社或者是杂志社数据库的创建或追加,请输入e键***"<<endl;
char letter;
cin>>letter;
switch (letter)
{
case'a':creatnewspaper(); cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'b':creatmagazine();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'c':newspaperlook();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'd':magazinelook();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
case'e':creatoffice();
cout<<"还需其它操作吗?(y/n):"; cin>>x;
break;
default:cout<<"输入数据不正确,是否再进行选择?(y/n):";
cin>>x;
}
}while(x=='y'||x=='Y');
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -