In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how C++ realizes the shuttle bus management system". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Now please follow the editor's train of thought slowly and deeply. Let's study and learn how C++ & Johnson implements the shuttle bus management system.
Design requirements:
A transportation company, the data of the shuttle bus system includes the following two parts:
① bus information: class delivery and bus number, maximum number of passengers, starting point, departure time, final place, arrival time, unit price
② passenger information: train number and train number, ID number, name, sex, date of birth, seat number.
The main ways for passengers to book tickets are as follows: passengers provide booking requirements such as starting point, time, destination and number of tickets, and decide whether passengers can book tickets according to the class data saved in advance. The booking process can be completed only after all the passengers' booking requirements have been met and there are enough unbooked seats on the scheduled flight, and modify the number of unbooked seats on the flight (the initial value of the unbooked number of seats in each class is the maximum number of passengers on that flight); otherwise, the booking fails and the reason why it cannot be booked is given.
Functional requirements:
⑴ increases the record of shifts.
The ⑵ flight is cancelled.
⑶ shift inquiry.
Book the ⑷ flight.
⑸ designs a menu that has at least the basic functions required by the above operations.
Program:
/ / kcsjbcxxcx.cpp: defines the entry point for the console application.
/ /
# include "stdafx.h"
# include
/ / # include
/ / # include
Using namespace std
Int naughty 0, no, no.
Struct date
{
Int year
Int month
Int day
}
Struct time
{
Int shi
Int fen
Int miao
}
Struct guanli
{
Char zh [15]
Char mima [20]
} guan1= {"zd1123xufei", "201211632326"}, guan2= {"minggezhijia", "zd2012cjjxx"}
Enum beiz
{
In the course of ticket sale, the train can be left and the flight can be cancelled.
Enum qid
{Zhanjiang}
Enum zhongd
{Guangzhou, Shenzhen, Dongguan, Foshan, Jieyang, Zhongshan, Maoming, Shantou}
Struct banche
{
Int bianhao; / / No.
Enum qid qidian; / / from
Enum zhongd zhongdian; / / Terminal
Int zuoweishu; / / maximum carrying capacity
Int shengyup; / / remaining number of passengers
Struct time fache; / / departure time
Enum beiz beizhu; / / remarks: whether ticket purchase and departure are available
Banche * next
}
Struct dingpiaoxx
{
Char xingming [30]
Char zheng [19]
Enum zhongd gpzd
Struct time shijian
Struct date riqi
Int piaoshu
Dingpiaoxx * NEXT
}
Banche * creat ()
Banche * insert (banche * head,banche * banc)
Banche * charu (banche * hea)
Void xiug (banche * hed)
Banche * del (banche * head)
Void chache (banche * head)
Dingpiaoxx * CREAT ()
Dingpiaoxx * dingpiao (dingpiaoxx * HEAD)
Void gaip (dingpiaoxx * HEAD)
Void xiup (dingpiaoxx * HED)
Void chapiao (dingpiaoxx * HEAD)
Dingpiaoxx * tianjia (dingpiaoxx * HEAD)
Dingpiaoxx * shanc (dingpiaoxx * HEAD)
Void welc ()
/ / void chushi ()
Void xuanze ()
Void weihu ()
Void kehu ()
Int denglu ()
/ * here is the main function * /
Int main ()
{
Char key='y'
Welc ()
/ / chushi ()
While (keyword in the box, in the box).
{
Xuanze ()
Int a,b
Cin > > a
If (aversion 1)
{
B=denglu ()
If (breadbasket 1)
{int gg=1
While (gg=1)
{weihu ()
Cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.