91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 17KB
    文件類型: .cpp
    金幣: 2
    下載: 0 次
    發布日期: 2024-02-03
  • 語言: C/C++
  • 標簽: 火車票??

資源簡介

課題內容和要求 火車票模擬訂票系統是功能包括:管理員管理系統和乘客訂票系統兩大子系統。 一、管理員系統中,管理員通過身份驗證,可以對火車時刻表進行插入、刪除、修改、查詢、顯示等操作。 二、乘客訂票系統中,乘客通過顯示的火車時刻表,可以查找車票、訂購車票、退訂車票。 三、退出系統時保存火車時刻表和乘客信息表。 PS:火車時刻表包含的數據:火車的車次、始發地、目的地、時間表、價格、余票數、編號。 乘客信息包含的數據:乘客的姓名、身份證、訂票數量、要訂火車的編號。

資源截圖

代碼片段和文件信息

#ifdef?WIN32
#pragma?warning?(disable:?4514?4786)
#endif
#ifndef?_TImetaBLE
#define?_TImetaBLE
#ifndef?_INTERFACE
#define?_INTERFACE
#include
#include
#include
#include
#include?
using?namespace?std;
class?Timetable
{
protected:
string?checi;/*車次*/
string?shifadi;/*始發地*/
string?mudidi;/*目的地*/
string?shijianbiao;?/*時間表*/
string?price;/*價格*/
int?yupiaoshu;/*余票數*/
string?bianhao;
public:
Timetable(string?ccstring?sfdstring?mddstring?sjbstring?pint?ypsstring?bianhao);/*構造函數*/
string?GetCheci();/*返回車次*/
string?GetShifadi();/*返回始發地*/
string?GetMudidi();/*返回目的地*/
string?GetShijianbiao();/*返回時間表*/
string?GetPrice();/*返回價格*/
int?GetYupiaoshu();/*返回余票數*/
string?GetBianhao();/*返回編號*/
bool?operator<(Timetable?tb)const;/*重載<運算,set容器要求元素之間滿足該關系*/
};
#endif
Timetable::Timetable(string?ccstring?sfdstring?mddstring?sjbstring?pint?ypsstring?bianha)//構造函數實現
{
checi=cc;
shifadi=sfd;
mudidi=mdd;
shijianbiao=sjb;
price=p;
yupiaoshu=yps;
bianhao=bianha;
}
string?Timetable::GetCheci()
{
return?checi;
}
string?Timetable::GetShifadi()
{
return?shifadi;
}
string?Timetable::GetMudidi()
{
return?mudidi;
}
string?Timetable::GetShijianbiao()
{
return?shijianbiao;
}
string?Timetable::GetPrice()
{
return?price;
}
int?Timetable::GetYupiaoshu()
{
return?yupiaoshu;
}
string?Timetable::GetBianhao()
{
return?bianhao;
}
bool?Timetable::operator<(Timetable?tb)const/*重載<運算,set容器要求元素之間滿足該關系*/
{
if(checi return?true;
else?
return?false;
}
class?Interface//管理員界面類
{
protected:
settable>tt;/*數據集*/
public:
Interface()
{ReadFile();}
void?Display();/*輸出界面信息*/
void?Run();/*運行界面主體功能*/
void?Insert();/*插入數據*/
void?Delete();/*刪除數據*/
void?Change();/*修改數據*/
void?Search();/*查詢數據*/
void?Output();/*輸出所有數據*/
void?ReadFile();/*從文件中讀取數據*/
void?Save();/*將數據保存到文件*/
void?PrintOne(settable>::iterator?t);
};/*輸出單條數據*/
#endif
void?Interface::Display()//輸出界面信息實現
{
cout< cout<<“▂▃▅▆██▆▅▃▂“< cout<<“┌一一一一一一一一┐“< cout<<“︱????管理員系統??︱“< cout<<“︱??0.退??????出??︱“< cout<<“︱??1.插入時刻表??︱“< cout<<“︱??2.刪除時刻表??︱“< cout<<“︱??3.修改時刻表??︱“< cout<<“︱??4.查詢時刻表??︱“< cout<<“︱??5.顯示時刻表??︱“< cout<<“└一一一一一一一一┘“<}
void?Interface::Run()/*運行界面主體功能*/
{
int?choice;
do
{
Display();
cout<<“請選擇需要的功能:“;
cin>>choice;
switch(choice)
{
case?0:
break;
case?1:
Insert();
break;
case?2:
Delete();
break;
case?3:
Change();
break;
case?4:
Search();
break;
case?5:
Output();
break;
}
}while(choice);
Save();
}
void?Interface::Save()/*將數據保存到文件*/
{
ofstream?out(“d:\\火車時刻表.txt“);
if(!out)
{
cout<<“Cannot?open?the?file\n“;
return;
}
settable>::iterator?t=tt.begin();
while(t!=tt.end())
{
out<GetCheci()<<‘?‘<GetShifadi()<<‘?‘<

評論

共有 條評論