立體化停車(chē)場(chǎng)設(shè)計(jì)書(shū)
立體化停車(chē)場(chǎng)設(shè)計(jì)書(shū)1.1課題任務(wù)設(shè)停車(chē)場(chǎng)有地下和地面兩層, 統(tǒng)一管理。 地下停車(chē)場(chǎng)采用單入口和單出口。 地上停車(chē)場(chǎng)采用南北方向的雙口,每個(gè)口都有一個(gè)入口和出口。停車(chē)順序先地面,后地下。地面入口處各有一個(gè)單車(chē)道的等候通道, 并允許等候的車(chē)輛因急事從等候通道直接開(kāi)走。 具體的設(shè)計(jì)任務(wù)如下:( 1)采用棧、隊(duì)列和有序表等數(shù)據(jù)結(jié)構(gòu)。( 2)等候車(chē)輛的管理。( 3)地下、地上停車(chē)位的管理。( 4)停車(chē)計(jì)費(fèi)功能 。1.2課題原理針對(duì)本次課程設(shè)計(jì)的具體要求, 我們?cè)O(shè)計(jì)了如下方案: 停車(chē)場(chǎng)部選擇棧作為基本數(shù)據(jù)結(jié)構(gòu),充分利用棧后進(jìn)先出的數(shù)據(jù)結(jié)構(gòu)特點(diǎn),停車(chē)場(chǎng)外部的等候區(qū)域,針對(duì)其“先到先出”的工作特點(diǎn),選擇隊(duì)列作為基本數(shù)據(jù)結(jié)構(gòu)。同時(shí)設(shè)計(jì)了計(jì)時(shí)計(jì)費(fèi)功能,會(huì)員制度,針對(duì)不同型號(hào),是否為會(huì)員的車(chē)輛進(jìn)行分類(lèi)收費(fèi)。2 需求分析2.1課題調(diào)研為了完成本次課程設(shè)計(jì)任務(wù), 我們對(duì)校園周邊的停車(chē)場(chǎng)運(yùn)作狀況進(jìn)行了一系列的前期調(diào)研,包括停車(chē)場(chǎng)的管理系統(tǒng)的運(yùn)行原理, 收費(fèi)標(biāo)準(zhǔn)等等, 為本次課程設(shè)計(jì)任務(wù)的完成打下了良好的基礎(chǔ)。2.2功能需求此次設(shè)計(jì)任務(wù),要求停車(chē)場(chǎng)分為上下兩層,上層為南北雙向入口和出口,下層為單向入口出口,并要求我們?cè)O(shè)計(jì)等待區(qū)域。對(duì)于收費(fèi)標(biāo)準(zhǔn),我們將不同型號(hào)的車(chē)分類(lèi)收費(fèi),同時(shí)增加會(huì)員管理制度,對(duì)于多次在本停車(chē)場(chǎng)停車(chē)的會(huì)員給予優(yōu)惠。3 方案設(shè)計(jì)3.1總體功能設(shè)計(jì)本次課程設(shè)計(jì)共分為四個(gè)主要功能:( 1)進(jìn)入停車(chē)場(chǎng)( 2)離開(kāi)停車(chē)場(chǎng)( 3)查看停車(chē)場(chǎng)現(xiàn)狀( 4)計(jì)費(fèi)功能針對(duì)進(jìn)入停車(chē)場(chǎng)的功能,我們?cè)O(shè)計(jì)了“先地上,后地下” ,的停放順序,當(dāng)?shù)厣夏媳彪p向任一停車(chē)場(chǎng)停滿(mǎn)后,再向該停車(chē)場(chǎng)進(jìn)車(chē),會(huì)顯示“停車(chē)場(chǎng)已滿(mǎn)”等提示信息,并將車(chē)輛停入有剩余車(chē)位的其他停車(chē)場(chǎng)。 當(dāng)所有停車(chē)場(chǎng)均無(wú)停車(chē)位時(shí), 到來(lái)車(chē)輛將會(huì)進(jìn)入等待區(qū)域, 一旦有車(chē)輛離開(kāi)停車(chē)場(chǎng),最先到達(dá)等待的區(qū)域的車(chē)輛將會(huì)進(jìn)入停車(chē)場(chǎng)。針對(duì)離開(kāi)停車(chē)場(chǎng)的功能,可選擇任一停車(chē)場(chǎng)出車(chē),并會(huì)根據(jù)停車(chē)時(shí)長(zhǎng),車(chē)輛類(lèi)型,以及是否為會(huì)員等信息給出本次停車(chē)的費(fèi)用。針對(duì)查看停車(chē)場(chǎng)現(xiàn)狀的功能,將顯示車(chē)牌號(hào),何處停車(chē)等相關(guān)信息。此外,我們還設(shè)計(jì)了計(jì)費(fèi)功能, 利用 windows 系統(tǒng)自帶函數(shù)獲取時(shí)間, 免去了人工手動(dòng)輸入時(shí)間的繁瑣步驟, 同時(shí),針對(duì)不同車(chē)型, 是否享受會(huì)員優(yōu)惠等差異制定了不同的收費(fèi)標(biāo)準(zhǔn),使停車(chē)場(chǎng)的運(yùn)行更為規(guī)化,合理化。3.2數(shù)據(jù)結(jié)構(gòu)設(shè)計(jì)本次課程設(shè)計(jì)主要使用了棧和隊(duì)列兩種數(shù)據(jù)結(jié)構(gòu), 具體的設(shè)計(jì)方案和操作過(guò)程將在個(gè)人報(bào)告中給出,在此不再贅述。3.3函數(shù)原型設(shè)計(jì)int main()system("color E1");cout<<endl;cout<<"<<endl;cout<<" <<<<<<<進(jìn)入停車(chē)場(chǎng)管理系統(tǒng)>>>>>>>"<<endl;cout<< ” "<<endl; cout<<endl;cout<<""<<endl;cout<<endl;cout<<endl;cout<<endl;Car w;int t = 1;s1.sInitStack();s2.sInitStack();temt1.sInitStack();s3.InitStack(&s3);temp1.InitStack(&temp1);shortcut.InitQueue();while (t)cout<<"= "<<endl;cout<<"*1. 進(jìn)入停車(chē)場(chǎng)*"<<endl;cout<<"* 2. 離開(kāi)停車(chē)場(chǎng)*"<<endl;cout<<"*3. 查看停車(chē)場(chǎng)現(xiàn)狀*"<<endl;cout<<"* 0. 退 出*"<<endl;cout<<"="<<endl;cout<<endl;cout<<" 請(qǐng)輸入功能選項(xiàng):"cin>>t;switch (t)case 1: CarIn(&s3,&s1,&s2, &shortcut); break;case 2: CarOut(&s3,&temp1,&s1,&s2,&temt1 ,&shortcut); break;case 3: LookNow(&s3, &temp1, &s1, &s2, &temt1, &shortcut,&w); break;case 0: break;return 0;3.4用戶(hù)界面設(shè)計(jì)運(yùn)行時(shí)為DOS界面,通過(guò)增加字符畫(huà),更換背景顏色等方法增加界面的美觀度。4 方案實(shí)現(xiàn)4.1開(kāi)發(fā)環(huán)境與工具開(kāi)發(fā)環(huán)境: VisualC+6.04.2個(gè)人設(shè)計(jì)實(shí)現(xiàn)(按組員分小節(jié))奕設(shè)計(jì)實(shí)現(xiàn)隊(duì)列類(lèi)的實(shí)現(xiàn):typedef struct QueueNode/隊(duì)列結(jié)構(gòu)Car data;struct QueueNode *next;QueueNode;class Queue/定義隊(duì)列類(lèi)public:QueueNode *front, *rear;Queue()cout<<"構(gòu)造函數(shù) "<<endl;Queue();int InitQueue();int DestroyQueue(Queue *Q);int EnterQueue(Queue *Q, Car c);int EmptyQueue(Queue*Q);int DeleteQueue(Queue *Q,Car *c);int QueueLength(Queue *Q);Queue:Queue()cout<<"析構(gòu)函數(shù) "<<endl;int Queue:EmptyQueue(Queue *Q)if (front=rear)cout<<" 隊(duì)列為空 "<<endl;return (TRUE);elsecout<<" 隊(duì)列不為空 "<<endl;return (FALSE);int Queue:InitQueue()/ 構(gòu)造一個(gè)空隊(duì)列front = (QueueNode *)malloc(sizeof(QueueNode);if (front = NULL)return (FALSE);elserear = front;front->next = NULL;cout<<" 構(gòu)造了一個(gè)空隊(duì)列"<<endl;return (TRUE);int Queue:DestroyQueue(Queue *Q)/ 銷(xiāo)毀一個(gè)隊(duì)列while (front)rear=front->next;free(front);front=rear;cout<<" 銷(xiāo)毀隊(duì)列成功"<<endl;return 1;int Queue:EnterQueue(Queue*Q, Car c)rear->next = (QueueNode *)malloc(sizeof(QueueNode);if (rear->next = NULL)cout<<"車(chē)輛入隊(duì)失敗 "<<endl;return (FALSE);elserear = rear->next;rear->data = c;/rear->data.licence= rear->data.leaved;cout<<"車(chē)輛入隊(duì)成功 "<<count<<endl;rear->next = NULL;count+;return (TRUE);int Queue:DeleteQueue(Queue *Q,Car *c)/ 刪除隊(duì)列元素QueueNode *t;if (EmptyQueue( Q)cout<<" 要查找車(chē)輛不存在!"<<endl;return (FALSE);elset = front->next;if (rear = t)rear = front;(*c)= t->data;front->next = t->next;free(t);cout<<" 車(chē)輛刪除成功"<<endl;count-;return (TRUE);int Queue:QueueLength(Queue *Q)if (front!=rear)cout<<" 此時(shí)隊(duì)列長(zhǎng)隊(duì)為"<<count-1<<endl;return 1;else return 0;王卓君設(shè)計(jì)實(shí)現(xiàn)Time 類(lèi):#include <stdio.h>#include <stdlib.h>#include <string.h>#include<iostream>#include <iomanip>#include <windows.h>#include <winbase.h>using namespace std;class Time/時(shí)間類(lèi)private:SYSTEMTIME LocalTime;int month;int day;int hour;int minuet;int second;public:Time()GetLocalTime(&LocalTime);/取系統(tǒng)時(shí)間void OutputTime();/輸出時(shí)間函數(shù)int getmonth() return LocalTime.wMonth;int getday() return LocalTime.wDay;int gethour() return LocalTime.wHour;int getminute() return LocalTime.wMinute;int getsecond() return LocalTime.wSecond;void save()month=getmonth();day=getday();hour=gethour();minuet=getminute();second=getsecond();Time();void Time:OutputTime()/輸出當(dāng)前系統(tǒng)時(shí)間cout<<" 當(dāng) 前 時(shí) 間 為 : "<<getmonth()<<"月 "<<getday()<<""<<getminute()<<"分 "<<getsecond()<<"秒 "<<endl;日"<<gethour()<<"時(shí)/ 主函數(shù)void main()Time t;t.OutputTime();cout<<"現(xiàn) 在 是"<<t.getminute()<<""<<t.getmonth()<<"分 "<<t.getsecond()<<"月"<<t.getday()<<"秒 "<<endl;日"<<t.gethour()<<"時(shí)Guest 類(lèi):#include <stdio.h>#include <stdlib.h>#include <string.h>#include<iostream>#include <iomanip>#include <windows.h>#include <winbase.h>static int carfre100=0;/static int carid=0;using namespace std;class Time/時(shí)間類(lèi)private:SYSTEMTIME LocalTime;int month;int day;int hour;int minuet;int second;public:Time()GetLocalTime(&LocalTime);/取系統(tǒng)時(shí)間void OutputTime();/輸出時(shí)間函數(shù)int getmonth() return LocalTime.wMonth;int getday() return LocalTime.wDay;int gethour() return LocalTime.wHour;int getminute() return LocalTime.wMinute;int getsecond() return LocalTime.wSecond;void save()month=getmonth();day=getday();hour=gethour();minuet=getminute();second=getsecond();Time();void Time:OutputTime()/輸出當(dāng)前系統(tǒng)時(shí)間cout<<" 當(dāng) 前 時(shí) 間 為 : "<<getmonth()<<""<<getminute()<<"分 "<<endl;月 "<<getday()<<"日"<<gethour()<<"時(shí)#define MAXSIZE 100 typedef struct /鏈表的最大長(zhǎng)度線性表的靜態(tài)單鏈表的存儲(chǔ)結(jié)構(gòu)/char data10;int data;int cur;component,SLinkListMAXSIZE;typedef struct Carint leaved;char licenceLICENCESIZE;Time arrive;Time leave;Car;class Guest:public Time/客戶(hù)類(lèi),繼承Time 類(lèi)public:Time t1,t2;SLinkList carid;/該數(shù)組存車(chē)牌號(hào)/char e10;int e;int j,k,v;int cartype;/車(chē)輛類(lèi)型:1 客車(chē)2貨車(chē)3轎車(chē)4 越野車(chē)5 跑車(chē)float price;public:Guest()for(int i=1,m=0;i<=100,m<100;i+,m+)caridm.cur=i;/caridi.data = "0000000"/j=0;Guest()intLocateElem(SLinkListcarid,int*e);/線性表定位函數(shù),查找值為e 的元素void saveid(Car *c,int v); float fee(Time t1,Time t2);/該函數(shù)儲(chǔ)存會(huì)員的車(chē)牌號(hào)和停車(chē)次數(shù)計(jì)算價(jià)格函float cutprice(float price,int v);/計(jì)算打折價(jià)格函數(shù);int Guest:LocateElem(SLinkList carid,int *e)/在靜態(tài)單鏈線性表中查找第個(gè)值為 i 的元素若找到,則返回它在表中的位序,否則返回下一1位k=0;/while(k&&strcmp(caridk.data,e)!=0)/在表中順鏈查找while(caridk.data != *e)k=caridk.cur;if(!caridk.data)j=k;k=0;return j+1;return k+1;/LocateElemfloat Guest:fee(Time t1,Time t2)/計(jì)算普通價(jià)格if(t1.getmonth()!=t2.getmonth()price=(t2.getmonth()-t1.getmonth()*3000;else if(t1.getday()!=t2.getday()price=(t2.getday()-t1.getday()*500;elseprice=(t2.gethour()-t1.gethour()*3600+(t2.getsecond()-t1.getsecond()*60+ (t2.getsecond()-t1.getsecond()*CHARGE;cout<<" 您的車(chē)是什么類(lèi)型? 1 客車(chē) 2 貨車(chē) 3 轎車(chē) 4 越野車(chē) 5 跑車(chē) "<<endl; cin>>cartype;switch(cartype)/1case 1:case 2:price=price*2;break;case 3:price=price;break;case 4:price=price*1.5;break;case 5:price=price*1.2;break;客車(chē)2貨車(chē)3轎車(chē)4 越野車(chē)5 跑車(chē)return price;float Guest:cutprice(float price,int v)/計(jì)算會(huì)員打折后的價(jià)格/int i = LocateElem(carid,*e);/調(diào)用線性表定位函數(shù)if(carfrev-1>=100)price=price*0.55;else if(carfrev-1>=50)price=price*0.7;else if(carfrev-1>=20)price=price*0.85;elseprice=price*0.95;return price;/LocateElem函數(shù)的測(cè)試函數(shù)void main()Guest guest;int e;SLinkList carid;for(int n=0,x=1111;n<5,x<=5555;n+,x=x+1111)caridn.data=x;for(int i=1,m=0;i<=100,m<100;i+,m+)caridm.cur=i;for(int y=5;y<100;y+)caridy.data=0;cout<<" 請(qǐng)輸入要查詢(xún)的值:"cin>>e;cout<<" 結(jié)果是存在第"<<guest.LocateElem(carid,&e)<<"位"<<endl;小玉設(shè)計(jì)實(shí)現(xiàn)voidCarOut1(SqStack*parking1,SqStack*parking2,SqStack*temt,Queue *shortcutt)int a;char licenceLICENCESIZE;Car c;Time t2;t2.save();Guest guest;t2.OutputTime();cout<<" 請(qǐng)輸入車(chē)牌號(hào):"gets(licence);printf("南停車(chē)場(chǎng)出車(chē)請(qǐng)輸入0,北停車(chē)場(chǎng)出車(chē)請(qǐng)輸入1.n");scanf("%d%*c", &a);if(!(a=1)int i = 0;s1.sPop(&s1, &c);while (strcmp(c.licence, licence) != 0 && s1.top!=0)temt1.sPush(&temt1, c);s1.sPop(&s1, &c);i+;c.leave=t2;int x;float price;cout<<"您是否是會(huì)員?1 是 2 否 "cin>>x;if(x=1)price=guest.fee(c.arrive,c.leave);price=guest.cutprice();elseprice=guest.fee(guest.t1,guest.t2);cout<<" 該車(chē)應(yīng)付 "<<fabs(price)<<" 元"<<endl; while (!s1.sEmpty(&s1)temt1.sPop(&temt1, &c);s1.sPush(&s1, c);if (!shortcut.EmptyQueue( &shortcut)shortcut.DeleteQueue(&shortcut,& c);s1.sPush(&s1, c);c.leave=t2;printf("n");elses2.sPop(&s2,&c);while (strcmp(c.licence, licence) != 0)temt1.sPush(&temt1, c);s2.sPop(&s2, &c);c.leave=t2;int x;float price;cout<<" 您是否是會(huì)員? 1 是 2 否 " cin>>x;if(x=1)price=guest.fee(c.arrive,c.leave);price=guest.cutprice();elseprice=guest.fee(guest.t1,guest.t2);cout<<" 該車(chē)應(yīng)付 "<<fabs(price)<<" 元"<<endl; while (!temt1.sEmpty(&temt1)temt1.sPop(&temt1, &c);s2.sPush(&s2, c);if (!shortcut.EmptyQueue(&shortcut)shortcut.DeleteQueue(&shortcut,& c);s2.sPush(&s2, c);printf("n");void CarOut2(Stack *park, Stack *temp,Queue *Q)char licenceLICENCESIZE;Car c;Time t2;t2.save();Guest guest;t2.OutputTime();cout<<" 請(qǐng)輸入車(chē)牌號(hào):"gets(licence);s3.Pop(&s3, &c);while (strcmp(c.licence, licence) != 0)temp1.Push(&temp1, c);s3.Pop(&s3, &c);c.leave=t2;int x;float price;cout<<" 您是否是會(huì)員? 1 是 2 否 " cin>>x;if(x=1)price=guest.fee(c.arrive,c.leave);price=guest.cutprice();elseprice=guest.fee(guest.t1,guest.t2);cout<<" 該車(chē)應(yīng)付 "<<fabs(price)<<" 元 "<<endl; while (!s3.EmptyStack(&temp1)temp1.Pop(&temp1, &c);s3.Push(&s3, c);if (!shortcut.EmptyQueue( Q)shortcut.DeleteQueue(&shortcut, &c);s3.Push(&s3, c);printf("n");void CarOut(Stack *park, Stack *temp,SqStack *parking1,SqStack *parking2,SqStack *temt ,Queue *shortcut)int P;cout<<" 地上停車(chē)場(chǎng)出車(chē)請(qǐng)輸入 1,地下停車(chē)場(chǎng)出車(chē)請(qǐng)輸入 2 " scanf("%d%*c", &P);switch(P)case 1:CarOut1(parking1, parking2,temt, shortcut );break;case 2:CarOut2(park, temp, shortcut);break;天舒設(shè)計(jì)實(shí)現(xiàn)typedef struct Carint licence;Car;class SqStackpublic:Car dataSTACKSIZE;int top;int base;SqStack();void InitSqStack(SqStack *s);int EmptySqStack(SqStack *s);int FullSqStack(SqStack *S);int SGetTop(SqStack *s,Car c);int SPush(SqStack *s,Car c);int SPop(SqStack *s,Car *c);SqStack:SqStack()/析構(gòu)函數(shù)int SqStack:EmptySqStack(SqStack *s)if (base=top)cout<<" 地上停車(chē)場(chǎng)現(xiàn)無(wú)車(chē),棧為空!"<<endl;return (TRUE);elsecout<<" 地上停車(chē)場(chǎng)現(xiàn)有車(chē),棧不為空!"<<endl;return (FALSE);int SqStack:FullSqStack(SqStack *S)if (top = STACKSIZE - 1)cout<<" 地上停車(chē)場(chǎng)車(chē)輛已滿(mǎn),棧滿(mǎn)!"<<endl;return (TRUE);elsecout<<" 地上停車(chē)場(chǎng)還有空位,棧未滿(mǎn)!"<<endl;return (FALSE);int SqStack:SPush(SqStack *S, Car c)if (FullSqStack(S)return (FALSE);elsetop+;datatop = c;cout<<" 車(chē)輛已入棧,成功停入地上停車(chē)場(chǎng) !"<<endl; return (TRUE);int SqStack:SPop(SqStack *S, Car *c)if (EmptySqStack(S)return (FALSE);else(*c) = datatop;top-;cout<<" 車(chē)輛已出棧,離開(kāi)地上停車(chē)場(chǎng),歡迎下次光臨!"<<endl;return (TRUE);int SqStack:SGetTop(SqStack *s,Car c)if(top=base)return FALSE;elsec=datatop-1;top-;return (TRUE);/若棧非空,則返回s 的棧頂元素;否則返回ERRORvoid SqStack:InitSqStack(SqStack *s)top=0;base=0;cout<<" 現(xiàn)構(gòu)造一個(gè)空棧!"<<endl;/置棧一個(gè)空棧Sclass Stackpublic:Car dataSTACKSIZE;int top;int base;Stack();void InitStack(Stack *s);int EmptyStack(Stack *s);int FullStack(Stack *S);int GetTop(Stack *s,Car c);int Push(Stack *s,Car c);int Pop(Stack *s,Car *c);Stack:Stack()cout<<" 現(xiàn)已構(gòu)造一個(gè)棧類(lèi)"<<endl;/析構(gòu)函數(shù)int Stack:EmptyStack(Stack *S)if (base=top)cout<<" 地下停車(chē)場(chǎng)現(xiàn)無(wú)車(chē),棧為空!"<<endl;return (TRUE);elsecout<<" 地下停車(chē)場(chǎng)現(xiàn)有車(chē),棧不為空!"<<endl;return (FALSE);int Stack:FullStack(Stack *S)if (top = STACKSIZE - 1)cout<<" 地下停車(chē)場(chǎng)車(chē)輛已滿(mǎn),棧滿(mǎn)!"<<endl;return (TRUE);elsecout<<" 地下停車(chē)場(chǎng)還有空位,棧未滿(mǎn)!"<<endl;return (FALSE);int Stack:Push(Stack *S, Car c)if (FullStack(S)return (FALSE);elsetop+;datatop = c;cout<<" 車(chē)輛已入棧,成功停入地下停車(chē)場(chǎng) !"<<endl; return (TRUE);int Stack:Pop(Stack *S, Car *c)if (EmptyStack(S)return (FALSE);else(*c) = datatop;top-;cout<<" 車(chē)輛已出棧,離開(kāi)地下停車(chē)場(chǎng),歡迎下次光臨!"<<endl;return (TRUE);int Stack:GetTop(Stack *s,Car c)if(top=base)return FALSE;elsec=datatop-1;top-;return (TRUE);/若棧非空,則返回s 的棧頂元素;否則返回ERRORvoid Stack:InitStack(Stack *s)top=0;base=0;cout<<" 現(xiàn)構(gòu)造一個(gè)空棧!"<<endl;/置棧一個(gè)空棧S嘉文設(shè)計(jì)實(shí)現(xiàn)void CarIn(Stack *park, SqStack *parking1,SqStack *parking2,Queue *shortcuttt)int q=1;Car c;Time t1;Guest guest;t1.OutputTime();t1.save();c.arrive=t1;cout<<endl;guest.saveid(&c);if(s3.FullStack(&s3)=1)&&(s1.sFullStack(&s1)=1)&&(s2.sFullStack(&s2)=1)cout<<" 停車(chē)場(chǎng)已滿(mǎn),新來(lái)的車(chē)在過(guò)道等待 !"<<endl; shortcut.EnterQueue( &shortcut, c);elseif(s1.sFullStack(&s1)=1)&&(s2.sFullStack(&s2)=1)cout<<"地上停車(chē)場(chǎng)已滿(mǎn),請(qǐng)停入地下停車(chē)場(chǎng)"<<endl;cout<<" 車(chē)已在停車(chē)場(chǎng)停車(chē),現(xiàn)在開(kāi)始計(jì)時(shí)cout<<endl;s3.Push(&s3, c);system("pause");"elseif(s1.sFullStack(&s1)=0)&&(s2.sFullStack(&s2)=0)cout<<" 南北停車(chē)場(chǎng)均有車(chē)位cout<<endl;"<<endl;cout<<"請(qǐng)選擇車(chē)輛進(jìn)口編號(hào),南:1,北:2"<<endl;cout<<" 請(qǐng)輸入入口方向:"scanf("%d%*c", &q);switch(q)case 1:s1.sPush(&s1,c);break;case 2:s2.sPush(&s2, c);break;else if(s1.sFullStack(& s1)=0)&&(s2.sFullStack(& s2)=1)cout<<" 北入口已滿(mǎn),車(chē)輛進(jìn)入南入口"<<endl;s1.sPush(&s1,c);system("pause");else if(s1.sFullStack(parking1)=1)&&(s2.sFullStack(parking2)=0)cout<<"南入口已滿(mǎn),車(chē)輛進(jìn)入北入口"<<endl;s2.sPush(&s2, c);system("pause");cout<<"車(chē)已在停車(chē)場(chǎng)停車(chē),現(xiàn)在開(kāi)始計(jì)時(shí)!"<<endl;cout<<" 請(qǐng)按任意鍵繼續(xù)操作 ! " getchar();system("cls");system("color b0");printf("n");voidLookNow(Stack *park,Stack *temp,SqStack*parking1,SqStack*parking2,SqStack*temt,Queue *shortcut,Car *c)QueueNode *p;while (!s1.sEmpty(&s1)s1.sPop(&s1,c);temt1.sPush(&temt1,* c);while (!temt1.sEmpty(&temt1)temt1.sPop(&temt1, c);cout<<"車(chē)輛停車(chē)信息"<<c->licence<<":地上南停車(chē)場(chǎng)停車(chē) "<<endl;s1.sPush(&s1,* c);while (!s2.sEmpty(&s2)s2.sPop(&temt1, c);temt1.sPush(&temt1, *c);while (!temt1.sEmpty(&temt1)temt1.sPop(&temt1, c);cout<<"車(chē)輛停車(chē)信息"<<c->licence<<":地上北停車(chē)場(chǎng)停車(chē) "<<endl;s2.sPush(&s2, *c);while (!s3.EmptyStack(&s3)s3.Pop(&s3, c);temp1.Push(&temp1, *c);while (!temp1.EmptyStack(&temp1)temp1.Pop(&temp1, c);cout<<"車(chē)輛停車(chē)信息"<<c->licence<<":地下停車(chē)場(chǎng)停車(chē) "<<endl;s3.Push(&s3, *c);p = shortcut->front->next;while (p != NULL)cout<<" 車(chē) 輛 停 車(chē) 信 息"<<c->licence<<": 排 隊(duì) 等 待中 ."<<endl;p = p->next;printf("n");int main()system("color E1");cout<<endl;cout<<" "<<endl;cout<<" <<<<<<<進(jìn)入停車(chē)場(chǎng)管理系統(tǒng)>>>>>>>"<<endl;cout<< "<<endl; cout<<endl;cout<<""<<end l;cout<<endl;cout<<endl;cout<<endl;Car w;int t = 1;s1.sInitStack();s2.sInitStack();temt1.sInitStack();s3.InitStack(&s3);temp1.InitStack(&temp1);shortcut.InitQueue();while (t)cout<<"= "<<endl;cout<<"* 1.進(jìn)入停車(chē)場(chǎng)*"<<endl;cout<<"cout<<"* 2. 離開(kāi)停車(chē)場(chǎng) * 3.查看停車(chē)場(chǎng)現(xiàn)狀"<<endl;*"<<endl;cout<<"* 0.退 出*"<<endl;cout<<"="<<endl;cout<<endl;cout<<" 請(qǐng)輸入功能選項(xiàng):"cin>>t;switch (t)case 1: CarIn(&s3,&s1,&s2, &shortcut); break;case 2: CarOut(&s3,&temp1,&s1,&s2,&temt1 ,&shortcut); break;case 3: LookNow(&s3, &temp1, &s1, &s2, &temt1, &shortcut,&w); break;case 0: break;return 0;5 測(cè)試與調(diào)試5.1個(gè)人測(cè)試(按組員分小節(jié))奕測(cè)試#include <stdio.h>#include <stdlib.h>#include <string.h>#include<iostream>#include <iomanip>#include <windows.h>#include <winbase.h>#include <math.h> #define STACKSIZE 3 / #define LICENCESIZE 10/ static int count=1;設(shè)置地下停車(chē)場(chǎng)容量設(shè)置車(chē)牌號(hào)#define TRUE 1#define FALSE 0using namespace std;typedef struct Carint leaved;char licenceLICENCESIZE;Car;typedef struct QueueNode/隊(duì)列結(jié)構(gòu)