第一范文网 - 专业文章范例文档资料分享平台

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

来源:用户分享 时间:2025/5/25 18:30:38 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

..

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<<\对不起,今天的这趟车的票尚未卖出,无法完成退票!\

专业资料

搜索更多关于: 基于C++的火车票管理系统C++课程设计 的文档
基于C++的火车票管理系统C++课程设计.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c7syx97v1249sc9l3ppnv1xep036fc3019bz_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top