基于C++的火车票管理系统C++课程设计 联系客服

发布时间 : 星期六 文章基于C++的火车票管理系统C++课程设计更新完毕开始阅读

..

c=loading(); cout<<\班次\发车时间\起点站\终点站\行车时间\额定载客量\已订票人数\ for(int i=0;i

\ \ \ \ \ \ time_t tval; struct tm *now; tval = time(NULL);

now = localtime(&tval);

if((now->tm_hour==car[i].Setout.hour&&now->tm_min>car[i].Setout.minutes)||(now->tm_hour>car[i].Setout.hour)) cout<<\此车已发出\ }

cout<<\输入回车键返回\ getchar(); getchar(); welcome(); }

//车次查询子函数 void Numbersearch(); void Finalsearch(); void chaxun() { string t; cout<<\按班次查询\ cout<<\按终点站查询\ cout<<\请输入您想选择的查询法前的数字:\ cin>>t; if(t==\ Numbersearch(); if(t==\ Finalsearch(); if(t!=\ { cout<<\输入有误,请重新输入\ chaxun(); } }

专业资料

..

//班次查询子函数 void Numbersearch() { loading(); int SearchNumber; cout<<\请输入您需要查找的班次号:\ cin>>SearchNumber; cout<<\班次\发车时间\起点站\终点站\行车时间\额定载客量\已订票人数\ cout<

\ \ \ \ \ \ cout<<\输入回车键返回\ getchar(); getchar(); welcome(); }

//终点站查询子函数 void Finalsearch() { int R;

R=loading(); int i;

char Address[MAX]; cout<<\请输入终点站名称:\ cin>>Address; cout<<\班次\发车时间\起点站\终点站\行车时间\额定载客量\已订票人数\ for(i=0;i

if((strcmp(Address,car[i].Zhongdian))==0) cout<

\ \

\ \ \ \ } cout<<\输入回车键返回\ getchar(); getchar(); welcome();

专业资料

..

}

//购买火车票子函数 void shoupiao() { int R; R=loading(); int i;

cout<<\请输入要订购的车票的班次:\ cin>>i;

if(i<=0||i>R) {

cout<<\对不起,今天没有这趟车,请明天再来,使用!\ cout<<\输入回车键返回\ getchar(); getchar(); welcome(); } time_t tval; struct tm *now; tval = time(NULL);

now = localtime(&tval);

if((now->tm_hour==car[i-1].Setout.hour&&now->tm_mintm_hour

if(car[i-1].Fixednumber

(car[i-1].Fixednumber)++; ofstream outfile;

outfile.open(\班次信息.txt\ for(i=0;i

cout<<\你的订票成功,请按时上车,使用!\ }

else cout<<\对不起,今天的这趟车的票已卖完,请明天再来,合作\ }

else cout<<\对不起,今天的这趟车已发出,请明天再来,合作\ cout<<\输入回车键返回\

专业资料

..

getchar(); getchar(); welcome(); }

//退订火车票子函数 void tuipiao() { int R; R=loading(); int i;

cout<<\请输入要退购的车票的班次:\ cin>>i;

if(i<=0||i>R) {

cout<<\对不起,今天没有这趟车,无法完成退票.使用!\ cout<<\输入回车键返回\ getchar(); getchar(); welcome(); }

time_t tval; struct tm *now; tval = time(NULL);

now = localtime(&tval);

if((now->tm_hour==car[i-1].Setout.hour&&now->tm_mintm_hour

if(car[i-1].Fixednumber>=1) {

car[i-1].Fixednumber-=1; ofstream outfile;

outfile.open(\班次信息.txt\ for(i=0;i

cout<<\退订车票成功,使用!\ }

else cout<<\对不起,今天的这趟车的票尚未卖出,无法完成退票!\

专业资料