停车场管理系统(C++)

这篇具有很好参考价值的文章主要介绍了停车场管理系统(C++)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

大二写的肯定会有很多很多很多缺点~希望大佬们能指出~给大家提供一个可以改的一个小东西,改成其他的什么什么也是可以的~有bug在评论区里说一下~952行~基本重要的都有注释~

本“项目”实现了:

1.大中小车型分类
2.进场候车道
3.时间的自动提取
4.车牌的判定
5.查询、进车、出库、经营情况管理、自动收费系统、退出系统的销毁等等基础内容
6.停车场车辆的实时显示
7.拿走能三连一下嘛~
8.停车场用的顺序表候车道用的队列

“项目”截图:

入站:

c++停车场管理系统,c++,c++,开发语言,算法

入候车场:

c++停车场管理系统,c++,c++,开发语言,算法

出站及候车场自动入库

c++停车场管理系统,c++,c++,开发语言,算法

查询:

c++停车场管理系统,c++,c++,开发语言,算法

经营详情:

c++停车场管理系统,c++,c++,开发语言,算法

退出系统:

c++停车场管理系统,c++,c++,开发语言,算法

全部代码:

说明:本代码为UTF-8编码要是报错了就改改编码另存一下,在c站找找怎么办~ 贴贴~文章来源地址https://www.toymoban.com/news/detail-792560.html


#include <string>
#include <iostream>
#include <time.h>
#include <string>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
// 车辆详情:
#define MaxSize 2

const double unitprice = 0.01;
using namespace std;
typedef struct
{
    int Tplace;
    string place;
    string time;
    string type;
    string license; // 车牌
    string provice; // 省份
    time_t current_time;
} peo;
// 总价钱
double totalPrice = 0;
// 车位的比较数组
int a[33] = {0};

string x1[6] = {""};
// 车牌号的比较数组
string x2[13] = {""};
vector<string> split(const string &str, const string &pattern);
void Getp(peo &e)
{ // 输入停车位
    cout << "停车位置:";
    int tplace;
    cin >> tplace;
    e.Tplace = tplace;
    e.place = e.type + "停车场" + to_string(tplace) + "号位";

    if ((e.Tplace > 2 || e.Tplace < 1))
    {
        cout << "该停车位不存在,请输入1~2的数字" << endl;
        Getp(e);
    }
    else
    {
        for (int x = 0; x < 6; x++)
        {
            if (x1[x].compare(e.place) == 0)
            {
                cout << "该停车位已被占用了哦~还请另找车位~" << endl;
                Getp(e);
            }
        }
    }
}
void Getn(peo &e)
{ // 输入车牌
    cout << "车牌号码:";
    string indexL; // 暂时车牌

    cin >> indexL;
    int index = indexL.find("·"); // 能找到“·”;
    if (index == 3)
    {
        vector<string> Tlicense = split(indexL, "·");
        if (Tlicense[0].length() == 3 && Tlicense[1].length() == 5)
        {
            string indexpro = indexL.substr(0, 2); // 找到省份;
            if (indexpro != "鲁" && indexpro != "京" && indexpro != "津" && indexpro != "冀" && indexpro != "晋" && indexpro != "蒙" && indexpro != "辽" && indexpro != "吉" && indexpro != "黑" && indexpro != "沪" && indexpro != "苏" && indexpro != "浙" && indexpro != "皖" && indexpro != "闽" && indexpro != "赣" && indexpro != "台" && indexpro != "豫" && indexpro != "鄂" && indexpro != "湘" && indexpro != "粤" && indexpro != "桂" && indexpro != "琼" && indexpro != "港" && indexpro != "澳" && indexpro != "渝" && indexpro != "川" && indexpro != "贵" && indexpro != "云" && indexpro != "藏" && indexpro != "陕" && indexpro != "甘" && indexpro != "青" && indexpro != "宁")
            {
                Getn(e);
                cout << "输入车牌号的省份有错哦,本停车场还不支持外国哦" << endl
                     << endl;
            }
            else
            {
                if (indexL[2] >= 'A' && indexL[2] <= 'Z')
                {
                    e.provice = indexpro;
                    e.license = indexL;
                }
                else
                {
                    cout << "车牌的第二位数要严格按照大写字母哦~不然就吃掉你!" << endl
                         << endl;
                }
            }
        }
        else
        {
            cout << "输入车牌号有错哦,请按样例格式输入(样例:鲁N·88888)" << endl
                 << endl;
            Getn(e);
        }
    }
    else
    {
        cout << "输入车牌号有错哦,请按样例格式输入(样例:鲁N·88888)" << endl
             << endl;
        Getn(e);
    }

    for (int x = 0; x < 13; x++)
    {
        if (x2[x] == e.license)
        {
            cout << "该牌车辆已在场,请重新确认您的车牌号后再输入哦~" << endl;
            Getn(e);
        }
    }
}
void Gett(peo &e)
{ // 输入时间
    cout << "停车时间为:";
    e.current_time = time(NULL);
    e.time = ctime(&e.current_time);
    cout << ctime(&e.current_time) << endl
         << endl;
}
void Settype(peo &e)
{ // 输入类型
    cout << "停车类型:";
    cin >> e.type;
    if (e.type.compare("大") != 0 && e.type.compare("中") != 0 && e.type.compare("小") != 0)
    {
        cout << "车辆类型输入有误,请检查后重新输入哦~" << endl;
        Settype(e);
    }
}
// 车牌
void Getn1(peo &e, string i)
{ // 输入队列进的车牌
    e.license = i;
}
void Gettt1(peo &e)
{ // 进队时间合体
    Getn(e);
    for (int x = 0; x < 13; x++)
    {
        if (x2[x] == "")
        {
            x2[x] = e.license;
            break;
        }
    }
}
void Get1(peo &e)
{ // 时间位置号码合体
    Getp(e);
    Getn(e);
    Gett(e);
    for (int x = 0; x < 7; x++)
    { // 将信息记录入数组
        if (x1[x] == "")
        {
            x1[x] = e.place;
            break;
        }
    }
    for (int x = 0; x < 13; x++)
    {
        if (x2[x] == "")
        {
            x2[x] = e.license;
            break;
        }
    }
}
void Out1(peo &e)
{
    cout << "停车位置:" << e.place << "  "
         << "车辆类型:" << e.type << "  "
         << "车牌号码:" << e.license << "  "
         << "停车时间:" << e.time << endl;
}
void Gettt(peo &e) // 队列钱
{
    time_t etime = time(NULL);
    string endtime = ctime(&etime);
    int mtime = etime - e.current_time;
    double indexPrice = 0;
    int seconds = mtime;
    int hours = seconds / 3600;               // 计算小时数
    int remainingSeconds = seconds % 3600;    // 计算剩余的秒数
    int minutes = remainingSeconds / 60;      // 计算分钟数
    remainingSeconds = remainingSeconds % 60; // 计算剩余的秒数
    seconds = remainingSeconds;               // 秒数
    cout << "本次停车于: " << endl
         << e.time << "\b\b开始 " << endl
         << "于 " << endtime << "\b\b结束 " << endl
         << "共耗时 " << hours << " 小时 " << minutes << " 分 " << seconds << " 秒 。" << endl;

    if (mtime <= 60)
    {
        cout << "本次停车时间小于1分钟 免费!" << endl;
    }
    else
    {
        cout << "本停车场收费规则为每秒" << unitprice << "元~" << endl;
        indexPrice = unitprice * mtime;
        cout << "本次停车费用为:" << indexPrice << "元~" << endl;
        totalPrice += indexPrice;
    }
}
// 分割字符串函数
vector<string> split(const string &str, const string &pattern)
{
    vector<string> ret;
    if (pattern.empty())
        return ret;
    size_t start = 0, index = str.find_first_of(pattern, 0);
    while (index != str.npos)
    {
        if (start != index)
            ret.push_back(str.substr(start, index - start));
        start = index + 1;
        index = str.find_first_of(pattern, start);
    }
    if (!str.substr(start).empty())
        ret.push_back(str.substr(start));
    return ret;
}
// 车辆详情 end

// 排队等候队列

typedef string ElemType1;
typedef struct qnode
{
    ElemType1 data;
    struct qnode *next;
} DataNode;
typedef struct
{
    DataNode *front;
    DataNode *rear;
} LinkQuNode;

void InitQueue(LinkQuNode *&q)
{ // 初始化
    q = new LinkQuNode();
    q->front = q->rear = NULL;
}
// 找找是否存在
bool findQueue(LinkQuNode *queue, ElemType1 data)
{
    DataNode *p = queue->front;
    while (p != NULL)
    {
        if (p->data == data)
        {
            return true;
        }
        p = p->next;
    }
    return false;
}
void DestroyQueue(LinkQuNode *&q)
{ // 销毁
    DataNode *pre = q->front, *p;
    if (pre != NULL)
    {
        p = pre->next;
        while (p != NULL)
        {
            free(pre);
            pre = p;
            p = p->next;
        }
        free(pre);
    }
    free(q);
}
bool QueueEmpty(LinkQuNode *q)
{ // 判断空否
    return (q->rear == NULL);
}
void EnQueue(LinkQuNode *&q, ElemType1 e)
{ // 进队
    DataNode *p;
    p = new DataNode();
    p->data = e;
    p->next = NULL;
    if (q->rear == NULL)
        q->front = q->rear = p;
    else
    {
        q->rear->next = p;
        q->rear = p;
    }
}
bool DeQueue(LinkQuNode *&q, ElemType1 &e)
{ // 出队
    DataNode *t;
    if (q->rear == NULL)
        return false;
    t = q->front;
    if (q->front == q->rear)
        q->front = q->rear = NULL;
    else
        q->front = q->front->next;
    e = t->data;
    free(t);
    return true;
}
int QueueLength(LinkQuNode *q)
{ // 队列的长度
    int length = 0;
    if (QueueEmpty(q))
        return length;
    else if (!QueueEmpty(q))
    {
        DataNode *p;
        p = q->front;
        while (p)
        {
            length++;
            p = p->next;
        }
        return length;
    }
    return length;
}
void DispQueue(LinkQuNode *q) // 输出等待
{
    DataNode *t = q->front;
    while (t != NULL)
    {
        cout << t->data << endl
             << endl;
        t = t->next;
    }
}
// 排队等候队列 end
// 停车顺序表
typedef peo ElemType;
typedef struct
{
    ElemType data[MaxSize];
    int length;
} SqList;                 // 顺序表类型
void InitList(SqList *&L) // 初始化
{
    L = new SqList();
    L->length = 0;
    for (int i = 0; i < MaxSize; i++)
    {
        L->data[i].license = "";
    }
}

void DestroyList(SqList *&L) // 销毁
{
    free(L);
}
bool ListEmpty(SqList *L) // 检查空
{
    return (L->length == 0);
}
int ListLength(SqList *L) // 长度
{
    return (L->length);
}
void DispList(SqList *L) // 输出
{
    int i;
    if (ListEmpty(L))
    {
        cout << "             当前类型停车位还没有车哦~" << endl;
        return;
    }
    for (i = 0; i < L->length; i++)
        Out1(L->data[i]); // stu类型
    printf("\n");
}

bool GetElem(SqList *L, int i, ElemType &e) // 求值
{
    if (i < 1 || i > L->length)
        return false;
    e = L->data[i - 1];
    return true;
}

int LocateElem(SqList *L, ElemType e) // 查找
{
    int i = 0;
    while (i < L->length && L->data[i].license != e.license)
        i++;
    if (i >= L->length)
        return 0;
    else
        return i + 1;
}

bool ListInsert(SqList *&L, int i, ElemType e) // 插入
{
    int j;
    if (i < 1 || i > L->length + 1)
        return false;
    i--;
    for (j = L->length; j > i; j--)
        L->data[j] = L->data[j - 1];
    L->data[i] = e;
    L->length++;
    return true;
}

bool ListDelete(SqList *&L, int i, ElemType &e) // 删除
{
    int j;
    if (i < 1 || i > L->length)
        return false;
    i--;
    e = L->data[i];
    for (j = i; j < L->length - 1; j++)
        L->data[j] = L->data[j + 1];
    L->length--;
    return true;
}

// 获取车辆类型
int Gettype(peo &e, SqList *L, SqList *L1, SqList *L2)
{

    for (int i = 0; i < L->length; i++)
    {
        if (e.license == L->data[i].license)
        {
            return 0;
        }
    }
    for (int i = 0; i < L1->length; i++)
    {
        if (e.license == L1->data[i].license)
        {
            return 1;
        }
    }
    for (int i = 0; i < L2->length; i++)
    {
        if (e.license == L2->data[i].license)
        {
            return 2;
        }
    }
    return -1;
} // 0为大1为中2为小否则返回-1

// 停车顺序表end

int main()
{

    LinkQuNode *q1, *q2, *q3, *q1max, *q1min; // 队列

    SqList *L, *LMin, *LMax; // 链表停车场

    InitQueue(q1);    // 进队
    InitQueue(q2);    // 出队结算
    InitQueue(q3);    // 出队结算
    InitQueue(q1max); // 出队结算
    InitQueue(q1min); // 出队结算
    InitQueue(q3);    // 出队结算

    InitList(L);    // 链表中
    InitList(LMax); // 链表大
    InitList(LMin); // 链表小

    string type = "请输入汽车类型";
    string userCarNum;
    char i = 'F'; // 操作标识符

    int overBigNum = 0;
    int oversmallNum = 0;
    int overmidNum = 0;

    int sumCar[3] = {0};

    ElemType e, efind; // 车辆对象
    ElemType1 e1, e2;  // 队列自定类型对象
    int e3;
    int iiiType;
    // 系统主体
    cout << "================欢迎使用c0re的停车场================" << endl
         << endl;
    cout << "本停车场分为3个类型每个类型最多可停放2辆汽车" << endl
         << endl;
    cout << "本停车场收费规则为每秒" << unitprice << "元~" << endl
         << endl;
    cout << "来停车系统会自动记录时间" << endl
         << endl;
    cout << "本停车场为三个类型分别配有能停放一个车辆的候车道" << endl
         << endl;
    while (i != 'E')
    {
        cout << "====================c0re系统界面====================" << endl
             << endl;

        cout << "             当前已停放" << ListLength(L) + ListLength(LMin) + ListLength(LMax) << "辆汽车~" << endl;

        cout << "大型车位停放车辆情况" << endl;
        DispList(LMax);
        cout << "中型车位停放车辆情况" << endl;
        DispList(L);
        cout << "小型车位停放车辆情况" << endl;
        DispList(LMin);
        if (!QueueEmpty(q1max))
        { // 候车区非空
            cout << "当前大型车辆候车区停放的车辆有:" << endl;
            DispQueue(q1max);
        }
        if (!QueueEmpty(q1))
        { // 候车区非空
            cout << "当前中型车辆候车区停放的车辆有:" << endl;
            DispQueue(q1);
        }
        if (!QueueEmpty(q1min))
        { // 候车区非空
            cout << "当前小型车辆候车区停放的车辆有:" << endl;
            DispQueue(q1min);
        }

        if (QueueEmpty(q1min) && QueueEmpty(q1) && QueueEmpty(q1max))
        { // 候车区空
            cout << "候车区暂无车辆哦" << endl;
        }
        cout << "您可以选择:" << endl
             << endl;
        cout << " A:入站"
             << "  "
             << "D:出站"
             << "  "
             << "F:查询"
             << "  "
             << "M:经营详情"
             << "  "
             << "E:退出系统" << endl
             << endl;
        cout << "请选择:";
        cin >> i;
        switch (i)
        {
        case 'A':
            //
            cout << "请输入您要停车的车辆的类型" << endl
                 << "(本停车场提供三种类型的车位请输入您的车辆类型)" << endl
                 << "输入“大”或“中”或“小”" << endl;
            Settype(e);
            if (e.type.compare("大") == 0)
            {
                if (ListLength(LMax) == 2)
                { // 停车场大车顺序表长度满2
                    if (QueueLength(q1max) == 1)
                    {
                        cout << "     目前已无停放大车车位,且候车道已满还请另寻他处停车~" << endl
                             << endl;
                        overBigNum++;
                    }
                    else if (QueueLength(q1max) != 1)
                    {
                        cout << "     目前无停放大车车位,还请在侯车道内等待~" << endl
                             << endl;
                        Gettt1(e); // 车牌
                        e1 = e.license;
                        EnQueue(q1max, e1); // 进队等
                        sumCar[0]++;
                    }
                }
                else
                {
                    if (ListLength(L) == 0 && ListLength(LMin) == 0 && ListLength(LMax) == 0)
                        cout << "您是本停车场的第一位顾客^v^可以获得1亿元代金券!" << endl;
                    else
                    {
                        cout << "当前已被使用的车位有:";
                        for (int x = 0; x < ListLength(LMax); x++)
                        { // 遍历显示被用的车位
                            for (int y = 0; y < 2; y++)
                            {
                                if (LMax->data[x].place == x1[y])
                                    cout << x1[y] << " ";
                            }
                        }
                    }
                    cout << endl
                         << "请输入入站汽车的相关信息:" << endl;
                    Get1(e); // 获取车牌车位时间
                    if (ListInsert(LMax, ListLength(LMax) + 1, e))
                    {
                        cout << "嘟噜噜~嘟噜噜~夸嚓,您的车已入库~~车主贴贴~" << endl
                             << endl;
                        sumCar[0]++;
                    }
                    else
                    {
                        cout << "嘟噜噜~嘟噜噜~夸嚓,不知道出现了什么问题呢?小的正在火速debug中" << endl
                             << endl;
                    } // 插入大停车场
                }
            }
            if (e.type.compare("中") == 0)
            {

                if (ListLength(L) == 2)
                { // 停车场大车顺序表长度满2
                    if (QueueLength(q1) == 1)
                    {
                        cout << "     目前已无停放中车车位,且候车道已满还请另寻他处停车~" << endl
                             << endl;
                        overmidNum++;
                    }
                    else if (QueueLength(q1) != 1)
                    {
                        cout << "     目前无停放中车车位,还请在侯车道内等待~" << endl
                             << endl;
                        Gettt1(e); // 车牌
                        e1 = e.license;
                        EnQueue(q1, e1); // 进队等
                        sumCar[1]++;
                    }
                }
                else
                {
                    if (ListLength(L) == 0 && ListLength(LMin) == 0 && ListLength(LMax) == 0)
                        cout << "您是本停车场的第一位顾客^v^可以获得1亿元代金券!" << endl;
                    else
                    {
                        cout << "当前已被使用的车位有:";
                        for (int x = 0; x < ListLength(L); x++)
                        { // 遍历显示被用的车位
                            for (int y = 0; y < 2; y++)
                            {
                                if (L->data[x].place == x1[y])
                                    cout << x1[y] << " ";
                            }
                        }
                    }
                    cout << endl
                         << "请输入入站汽车的相关信息:" << endl;
                    Get1(e); // 获取车牌车位时间
                    if (ListInsert(L, ListLength(L) + 1, e))
                    {
                        cout << "嘟噜噜~嘟噜噜~夸嚓,您的车已入库~~车主贴贴~" << endl
                             << endl;
                        sumCar[1]++;
                    }
                    else
                    {
                        cout << "嘟噜噜~嘟噜噜~夸嚓,不知道出现了什么问题呢?小的正在火速debug中" << endl
                             << endl;
                    } // 插入大停车场
                }
            }
            if (e.type.compare("小") == 0)
            {
                if (ListLength(LMin) == 2)
                { // 停车场大车顺序表长度满2
                    if (QueueLength(q1min) == 1)
                    {
                        cout << "     目前已无停放小车车位,且候车道已满还请另寻他处停车~" << endl
                             << endl;
                        oversmallNum++;
                    }
                    else if (QueueLength(q1min) != 1)
                    {
                        cout << "     目前无停放小车车位,还请在侯车道内等待~" << endl
                             << endl;
                        Gettt1(e); // 车牌
                        e1 = e.license;
                        EnQueue(q1min, e1); // 进队等
                        sumCar[2]++;
                    }
                }
                else
                {
                    if (ListLength(L) == 0 && ListLength(LMin) == 0 && ListLength(LMax) == 0)
                        cout << "您是本停车场的第一位顾客^v^可以获得1亿元代金券!" << endl;
                    else
                    {
                        cout << "当前已被使用的车位有:";
                        for (int x = 0; x < ListLength(LMin); x++)
                        { // 遍历显示被用的车位
                            for (int y = 0; y < 2; y++)
                            {
                                if (LMin->data[x].place == x1[y])
                                    cout << x1[y] << " ";
                            }
                        }
                    }
                    cout << endl
                         << "请输入入站汽车的相关信息:" << endl;
                    Get1(e); // 获取车牌车位时间
                    if (ListInsert(LMin, ListLength(LMin) + 1, e))
                    {
                        cout << "嘟噜噜~嘟噜噜~夸嚓,您的车已入库~~车主贴贴~" << endl
                             << endl;
                        sumCar[2]++;
                    }
                    else
                    {
                        cout << "嘟噜噜~嘟噜噜~夸嚓,不知道出现了什么问题呢?小的正在火速debug中" << endl
                             << endl;
                    } // 插入小停车场
                }
            }

            break;
            // 改到这里了!!!2022年12月20日
        case 'D':

            if (ListEmpty(L) && ListEmpty(LMin) && ListEmpty(LMax))
                cout << "             没生意啊好心酸TvT~" << endl;
            else
            {
                cout << endl
                     << "请输入要出站的车的车牌号:";
                ElemType i1;
                cin >> i1.license; // 车牌

                int Type = Gettype(i1, LMax, L, LMin);
                bool panduan = false;

                if (Type == 0)
                {
                    panduan = ListDelete(LMax, LocateElem(LMax, i1), e);
                }
                else if (Type == 1)
                {
                    panduan = ListDelete(L, LocateElem(L, i1), e);
                }
                else if (Type == 2)
                {
                    panduan = ListDelete(LMin, LocateElem(LMin, i1), e);
                }
                else
                {
                    panduan = false;
                }

                if (panduan)
                { // 查找并删除,e是被删的车s
                    cout << "车牌号为" << e.license << "的汽车已驶入结算区~" << endl;
                    e2 = e.license; // 获取车牌

                    cout << "车牌为" << e2 << "的车辆现进行费用结算~!" << endl;
                    Gettt(e); // 算钱
                    cout << "车牌号为" << e2 << "的汽车已驶出停车场~~~!" << endl;
                    for (int x = 0; x < 13; x++)
                    { // 出场的车销毁车牌
                        if (x2[x] == e2)
                        {
                            x2[x] = "";
                            break;
                        }
                    }
                    // 改到这里了
                    if (Type == 0)
                    {
                        if (!QueueEmpty(q1max))
                        {                       // 进队列非空
                            DeQueue(q1max, e1); // 出队(车牌
                            Getn1(e, e1);       // 车牌获取
                            cout << "车牌为" << e.license << "的车辆现可以入库~!还请确定入库时间:" << endl;
                            Gett(e);                                   // 进场时间
                            ListInsert(LMax, ListLength(LMax) + 1, e); // 插入
                        }
                        else
                        {
                            for (int x = 0; x < 6; x++)
                            { // 车位删除
                                if (x1[x] == e.place)
                                {
                                    x1[x] = "";
                                    break;
                                }
                            }
                        }
                    }
                    else if (Type == 1)
                    {

                        if (!QueueEmpty(q1))
                        {                    // 进队列非空
                            DeQueue(q1, e1); // 出队(车牌
                            Getn1(e, e1);    // 车牌获取
                            cout << "车牌为" << e.license << "的车辆现可以入库~!还请确定入库时间:" << endl;
                            Gett(e);                             // 进场时间
                            ListInsert(L, ListLength(L) + 1, e); // 插入
                        }
                        else
                        {
                            for (int x = 0; x < 6; x++)
                            { // 车位删除
                                if (x1[x] == e.place)
                                {
                                    x1[x] = "";
                                    break;
                                }
                            }
                        }
                    }
                    else if (Type == 2)
                    {

                        if (!QueueEmpty(q1min))
                        {                       // 进队列非空
                            DeQueue(q1min, e1); // 出队(车牌
                            Getn1(e, e1);       // 车牌获取
                            cout << "车牌为" << e.license << "的车辆现可以入库~!还请确定入库时间:" << endl;
                            Gett(e);                                   // 进场时间
                            ListInsert(LMin, ListLength(LMin) + 1, e); // 插入
                        }
                        else
                        {
                            for (int x = 0; x < 6; x++)
                            { // 车位删除
                                if (x1[x] == e.place)
                                {
                                    x1[x] = "";
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    cout << "不存在此车辆哦~请检查后重新输入~~" << endl;
                }
            }

            break;
        case 'M':
            time_t rawtime;
            struct tm *timeinfo;

            time(&rawtime);
            timeinfo = localtime(&rawtime);
            char buffer[80];
            strftime(buffer, 80, "%Y年%m月%d日", timeinfo);

            cout << "==============c0re停车场" << buffer << "经营详情============" << endl
                 << endl;
            cout << "大车停车总计:" << sumCar[0] << "辆" << endl
                 << endl;
            cout << "中车停车总计:" << sumCar[1] << "辆" << endl
                 << endl;

            cout << "小车停车总计:" << sumCar[2] << "辆" << endl
                 << endl;

            cout << "因大停车场满而未停车总计:" << overBigNum << "辆" << endl
                 << endl;
            cout << "因中停车场满而未停车总计:" << overmidNum << "辆" << endl
                 << endl;
            cout << "因小停车场满而未停车总计:" << oversmallNum << "辆" << endl
                 << endl;

            if (overBigNum != 0)
            {
                cout << "建议多增加" << overBigNum << "辆大车位" << endl
                     << endl;
            }
            if (overmidNum != 0)
            {
                cout << "建议多增加" << overmidNum << "辆中车位" << endl
                     << endl;
            }
            if (oversmallNum != 0)
            {
                cout << "建议多增加" << oversmallNum << "辆小车位" << endl
                     << endl;
            }

            cout << "$$$$$$$$$$$$$$$  目前已累计收入" << totalPrice << "元  $$$$$$$$$$$$$$$$" << endl
                 << endl;
            break;
        case 'E':
            cout << endl
                 << "     c0re竭诚为您服务,欢迎下次再来~" << endl;

            // 销毁
            DestroyList(L);
            DestroyList(LMax);
            DestroyList(LMin);

            DestroyQueue(q1);
            DestroyQueue(q1max);
            DestroyQueue(q1min);

            DestroyQueue(q2);
            DestroyQueue(q3);
            break;
        case 'F':

            cout << "欢迎来到c0re停车场的查询系统~" << endl;
            cout << "宝贝请输入爱车车牌号:";
            cin >> userCarNum;
            efind.license = userCarNum;
            iiiType = Gettype(efind, LMax, L, LMin);
            if (findQueue(q1max, userCarNum))
            {
                cout << "您的爱车在大型车辆候车道~等大型停车场有车出来时您就可以进去了哦" << endl
                     << endl;
            }
            else if (findQueue(q1min, userCarNum))
            {
                cout << "您的爱车在小型车辆候车道~等大型停车场有车出来时您就可以进去了哦" << endl
                     << endl;
            }
            else if (findQueue(q1, userCarNum))
            {
                cout << "您的爱车在中型车辆候车道~等大型停车场有车出来时您就可以进去了哦" << endl
                     << endl;
            }

            else if (iiiType == 0)
            {
                GetElem(LMax, LocateElem(LMax, efind), efind);
                cout << "您的爱车在大型车辆停车场~详细信息如下:" << endl;
                Out1(efind);
            }
            else if (iiiType == 2)
            {
                GetElem(LMin, LocateElem(LMin, efind), efind);
                cout << "您的爱车在小型车辆停车场~详细信息如下:" << endl;
                Out1(efind);
            }
            else if (iiiType == 1)
            {
                GetElem(L, LocateElem(L, efind), efind);
                cout << "您的爱车在中型车辆停车场~详细信息如下:" << endl;
                Out1(efind);
            }
            else
            {
                cout << "没有找到呢QWQ" << endl;
            }

            break;

        default:
            cout << "您的输入有误,请检查后重新输入~" << endl;
        }
    }
    system("pause");
    return 0;
}

到了这里,关于停车场管理系统(C++)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 基于python的停车场管理系统的设计与实现/智能停车管理系统

    车位信息 是 停车场供应用户 必不可少的一个部分。在 停车场发展 的整个过程中, 车位信息 担负着最重要的角色。为满足如今日益复杂的管理需求,各类 系统管理 程序也在不断改进。本课题所设计的 停车场管理系统 , 使用 Django 框架 , Python语言 进行开发,它的优点代

    2024年02月10日
    浏览(30)
  • 停车场管理系统(C语言)

    1、问题描述 设有一个可以停放n辆汽车的狭长停车场,它只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚依次从停车场最里面向大门口处停放(最先到达的第一辆车放在停车场的最里面)。如果停车场已放满n辆车,则后来的车辆只能在停车场大门外的便道上等待

    2024年02月04日
    浏览(29)
  • 用JAVA实现停车场管理系统

    该程序使用ArrayList存储停车记录,并通过switch-case语句实现菜单选择功能。主要功能包括: 停车:输入车牌号和进入时间,自动分配停车位编号, 结算:根据停车位编号计算停车费用,计费标准为停车时长(秒)乘以每秒费用0.05元,同时记录车辆离开时间和费用; 查看记录

    2024年02月11日
    浏览(31)
  • 数据结构停车场管理系统设计

    数据结构与算法分析课程设计之数据结构停车场管理系统设计。主要应用到数据结构中的栈与队列。运用到的编程语言为C++。 目录 一  设计要求  二 思路分析 三 设计流程 先附上完整代码: 运行结果图: 1.1 问题描述 :设停车场是一个可停放n辆车的狭长通道,且只有一个

    2024年02月04日
    浏览(30)
  • Python 实验报告,实现停车场收费管理系统

    3.某小型收费停车场有50个车位,有一个入口与一个出口,满1小时收费1元,不足1小时不收费,10元封顶,超过1天罚款200元。编写程序实现停车场出入口管理。 要求: (1)定义出入口类,将车位总数与目前停在停车场的车辆信息(每辆车包括车牌和入场时间)定义为类属性;

    2024年02月12日
    浏览(33)
  • 基于Web的停车场管理系统(Java)

    目录 一、系统介绍 1.开发的环境 2.本系统实现的功能 3.数据库用到的表 4.工程截图 二、系统展示 1、登录页面  2、首页 3、系统信息管理模块   4、车位信息管理模块  5、IC卡信息管理模块 ​编辑6、固定车主停车管理模块 7、临时车主停车管理模块 8、系统功能操作模块 三

    2024年02月10日
    浏览(27)
  • 【数据结构】停车场管理系统程序设计

    说明: 该程序设计采用常见基础的数据结构栈和队列实现了一个简单停车场管理系统。在具体设计中,实现了系统页面和停车场的示意图显示,通过调用顺序栈和链队的相关函数,模拟了实际停车场的运营流程。 目录 1 任务内容 2 需求分析 2.1 功能需求 2.2 输入输出需求 3 概

    2024年02月03日
    浏览(33)
  • 【计算机毕业设计】智能停车场管理系统

          摘 要 本论文主要论述了如何使用JAVA语言开发一个智能停车场管理系统,本系统将严格按照软件开发流程进行各个阶段的工作,采用B/S架构,面向对象编程思想进行项目开发。在引言中,作者将论述智能停车场管理的当前背景以及系统开发的目的,后续章节将严格按照

    2024年02月06日
    浏览(29)
  • 模拟停车场管理系统(c++,使用栈和队列)

    目录 一、问题描述 二、算法结构分析与设计 三、算法主模块的流程及各子模块的主要功能 四、算法详细设计 五、源代码 功能要求         设停车场只有一个可以停放几辆汽车的狭长通道,且只有一个大门可供汽车进出。汽车在停车场内按车辆到达的先后顺序依次排列

    2024年02月08日
    浏览(27)
  •  基于JAVAEE的停车场管理系统(论文+PPT+源码)

      详情介绍 毕业设计(论文) 论文题目 基于JAVAEE的停车场管理系统 Thesis Topic JAVAEE – based parking management system 毕业设计(论文)任务书 毕业设计(论文)题目:基于JAVAEE的停车场管理系统毕业设计(论文)要求及原始数据(资料):1.了解当前停车场管理的实际需求,确

    2024年02月03日
    浏览(47)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包