某停车场车辆出入库模拟系统

#include<cstdio>
#include<cmath>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<windows.h>
using namespace std;

void GotoXY(int x, int y)  // 移动 
{
    HANDLE hout;  //屏幕尺寸 变量 
    COORD coord={x,y};  //光标坐标 变量  光标x标  光标y标 
    hout=GetStdHandle(STD_OUTPUT_HANDLE);  //获得屏幕尺寸 
    SetConsoleCursorPosition(hout,coord);  //移动光标 
}
bool isLeapYear(int year)
    //判断是否为闰年 
{
    return ((year%4==0 && year%100!=0) || year%400==0);
}

int getDays(int year, int month, int day)
    // 以公元 1 年 1 月 1 日为基准,计算经过的日期 
{
    int m[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    
    if(isLeapYear(year))
    {
        m[2]++;
    }
    
    int result = 0;
    
    for(int i = 1;i < year;i++)
    {
        result += 365;
        if(isLeapYear(i))
        {
            result ++;
        }
    }
    for(int i = 1;i < month;i++)
    {
        result += m[i];
    }
    result += day;
    
    return result;
}
int dayDis(    int year1,    int month1,    int day1,
            int year2,    int month2,    int day2)
    //计算日期差 
{
    return abs(getDays(year2, month2, day2) - getDays(year1, month1, day1));
}

class customer//顾客信息 
{
    public:
        string name;        //顾客姓名 
        string license;     //顾客车牌号 
        //入库时间 
        int yearin;
        int monthin;
        int dayin;
        int hourin;
        int minutein;
        
        int yearout;        //出库时间 
        int monthout;
        int dayout;
        int hourout;
        int minuteout;
        int starlevel;
        
        int the_time;        //停车时长 
        
        float the_money;        //停车价格 
};
class allcustomer
{
    public:
        customer line[20]; 
        
        float them0;        //0星会员每小时收费 them0 元 
        
        int the1fd;            //1星会员收费分the1fd段 
        int the1j[10];        //1星会员收费每段收费截止到 the1j[i]时 
        float the1em[10];    //1星会员每段每小时收费 the1em[i] 元 
        
        float them2;        //2星会员每小时收费 them2 元 
        int the2fd;            //2星会员收费分the2fd段 
        float the2j[10];    //2星会员收费每段收费截止到 the2j[i]元时 
        float the2em[10];    //2星会员每段满减为 the2em[i]元
        
        float them3;        //3星会员每小时收费 them3 元 
        
};
void guanli(allcustomer *thep,int Customer_number,string zhanghao,string mima);

void guke(allcustomer *thep,int Customer_number,string zhanghao,string mima);

void set(allcustomer *thep,int Customer_number,string zhanghao,string mima);

void newset(allcustomer *thep,int Customer_number,string zhanghao,string mima);

float money0(allcustomer *thep,int Customer_number,string zhanghao,string mima);

float money1(allcustomer *thep,int Customer_number,string zhanghao,string mima);

float money2(allcustomer *thep,int Customer_number,string zhanghao,string mima);

float money3(allcustomer *thep,int Customer_number,string zhanghao,string mima);

int main()
{
    allcustomer thecustomer;
    //allcustomer *tp;
    //tp=&thecustomer;
    int cnumber; 
    cnumber=0;
    
    string zerozhanghao,zeromima;
    
    zerozhanghao="0";        //初始账号为"0" 
    
    zeromima="0";            //初始密码为"0" 
    
    newset(&thecustomer,cnumber,zerozhanghao,zeromima);
//    retuen 0; 
}
void guanli(allcustomer *thep,int Customer_number,string zhanghao,string mima)
{
    
    {
        
        printf("输入0设置0星会员收费\n");
        printf("输入1设置1星会员收费\n");
        printf("输入2设置2星会员收费\n");
        printf("输入3设置3星会员收费\n");
        printf("输入5修改管理员账号\n");
        printf("输入6修改管理员密码\n");
        printf("输入8展示所有顾客\n");
        printf("输入9返回\n");
    }
    
    int thechoice;
    cin>> thechoice;
    
    if(thechoice==0)//设置0星会员收费 
    {
        system("cls");
        printf("当前0星会员每小时收费%.2f元\n",thep->them0);
        printf("新设置0星会员每小时收费");
        cin>>thep->them0;
        printf("当前0星会员每小时收费%.2f元\n",thep->them0);
        system("pause");
        set(thep,Customer_number,zhanghao,mima);
    }
    
    if(thechoice==1)//设置1星会员收费 
    {
        system("cls");
        printf("当前1星会员收费分%d段\n",thep->the1fd);
        for(int i=1;i<=thep->the1fd;i++)
        {
            printf("第%d段收费截止到%d时 每小时收费%.2f元\n",i,thep->the1j[i],thep->the1em[i]);
        }
        printf("新设置1星会员收费分多少段\n");
        cin>>thep->the1fd;
        for(int i=1;i<=thep->the1fd;i++)
        {
       &

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值