TP09 指导学习:汽车租赁系统 ACCP 6.0 S2-1-深入.NET平台和C#编程 PPT课件
- 格式:ppt
- 大小:1.15 MB
- 文档页数:20


汽车租赁系统的c语言,数据结构的语言程序【问题描述】汽车租赁公司拥有若干种不同类别的汽车,允许持有相应类别驾照的顾客租赁汽车,按照租赁的汽车类型和租赁的时间进行收费,租赁最长时间不能超过一周;若延迟归还,则按延迟的时间进行罚金处理。
其中,汽车信息包括:汽车编号、类别、收费标准、库存数量、延迟归还罚金标准;(汽车类别分为A、B、C三类,收费标准每天分别为:400、300、200元,延迟归还的罚金标准分别为:每天600、500、400元。
)顾客租赁信息包括:顾客编号、顾客名、驾照类别(A、B、C三类)、租赁的汽车编号、租赁天数、延迟归还的天数)。
主要用到的知识点有:结构体、线性表、函数【基本要求】设计一个汽车租赁管理系统,能够完成以下功能:查询并显示汽车信息、顾客的租赁信息顾客租赁汽车:首先检查顾客驾照类别,然后查询相应类别的汽车数量,若可租赁,则添加顾客信息、同时修改汽车库存量。
顾客归还汽车:首先检查归还日期并计算费用,然后删除该顾客的租赁信息表、修改汽车库存量。
系统以菜单的方式工作:运行界面可选择要执行的操作是查询?租赁还是归还?【测试数据】由读者自行设定编译器是VC6#include<stdio.h>#include<stdlib.h>#include<string.h>#define MaxNum 20typedef struct A{int No; /*车辆编号*/char Type; /*车类型*/int Payment;/*租费*/int fine; /*罚金*/struct A *next;/*指向下一个结点*/} car;typedef struct B{int No; /*顾客编号*/char Name[20]; /*顾客姓名*/char License; /*执照类别*/int carNo; /*租凭的车辆编号*/int Day; /*租的天数*/int DelayDay;/*延迟的天数*/struct B *next;} client;struct C{/*这个结构体是车辆链表的头结点,A,B,C每种类型有一种*/char Type;/*车辆型号*/int avl; /*可用数*/car *head;/*指向车辆结点*/}headNode[3]={{'A',MaxNum,NULL},{'B',MaxNum,NULL},{'C',MaxNum,NULL}} ; client *allClien=NULL;int pay[3]={400,300,200},fine[3]={600,500,400};void init();/*初始化*/int menu();/*简单菜单界面*/void search();/*查询*/void carSc(); /*查询车辆*/void clientSc();/*查询顾客*/void rent(); /*租车*/void giveback();/*还车*/void addCli(client *cli);/*向顾客链表增加顾客*/client* delCli(int clientNo);/*从顾客链表删除一个顾客*/void addCar();/*向车辆链表归还车辆*/car* delCar();/*从车辆链表拿出一辆车*/void Exit();/*退出*/void main(){init();while(1){switch(menu()){case 1:search();break;case 2:rent();break;case 3:giveback();break;case 4:Exit();default:;}}}void init(){int i;car*ptr,*pa=headNode[0].head,*pb=headNode[1].head,*pc=headNode[2].head; for(i=1;i<=MaxNum;i++){ptr=(car *)malloc(sizeof(car));ptr->No=100+i;ptr->Type='A';ptr->Payment=400;ptr->fine=600;pa=ptr;pa=ptr->next;ptr=ptr=(car *)malloc(sizeof(car));ptr->No=200+i;ptr->Type='B';ptr->Payment=300;ptr->fine=500;pb=ptr;pb=ptr->next;ptr=(car *)malloc(sizeof(car));ptr->No=300+i;ptr->Type='C';ptr->Payment=200;ptr->fine=400;pc=ptr;pc=ptr->next;}pa=NULL;pb=NULL;pc=NULL;}int menu(){int choice;printf("\n\n\n选择服务:1.查询2.租车3.归还4.退出\n"); scanf("%d",&choice);while(choice!=1&&choice!=2&&choice!=3&&choice!=4) {printf("\n输入有误,重新输入:");scanf("%d",&choice);}return choice;}void search(){int choice;printf("\n你想查询:1.汽车2.顾客3.返回\n");scanf("%d",&choice);while(choice!=1&&choice!=2&&choice!=3){printf("\n输入有误,重新输入:");scanf("%d",&choice);}switch(choice){case 1:carSc(); break;case 2:clientSc(); break;case 3: ;default:;}}void carSc(){printf("\n\n所有汽车信息:\n");printf("\nA类汽车还剩%d辆.\nB类汽车还剩%d辆.\nC类汽车还剩%d辆.", headNode[0].avl,headNode[1].avl,headNode[2].avl);}void clientSc(){client *ptr=allClien;printf("\n\n所有顾客信息:\n");while(ptr!=NULL){ printf("\n\n顾客编号:%d",ptr->No);printf("\n顾客姓名:%s",ptr->Name);printf("\n驾照类型:%c",ptr->License);printf("\n租赁车号:%d",ptr->carNo);printf("\n租赁天数:%d",ptr->Day);printf("\n延迟天数:%d",ptr->DelayDay);ptr=ptr->next;}}void addCli(client *cli){if(allClien)allClien=cli;else{cli->next=allClien->next;allClien=cli;}}client* delCli(int clientNo){client *ptr,*prePtr;;ptr=allClien;while(ptr!=NULL&&ptr->No!=clientNo){ prePtr=ptr;ptr=ptr->next;}if(ptr!=NULL){if(ptr==allClien){allClien=NULL;}else{prePtr->next=ptr->next;}}return ptr;}void rent(){char name[20],type,Yes_No;int num,day,No;car *carPtr;client *cli;printf("\n\n输入执照类型(A/B/C):");scanf("%c",&type);while(type!='A'&&type!='B'&&type!='C'){printf("输入有误,重新输入:");scanf("%c",&type);}if(type=='A')num=headNode[0].avl;else if(type=='B')num=headNode[1].avl;elsenum=headNode[2].avl;printf("\n%c类汽车还剩%d辆,是否要租凭(Y/N):",type,num); scanf("%c",&Yes_No);while(Yes_No!='Y'&&Yes_No!='N'&&Yes_No!='y'&&Yes_No!='n') {printf("Y或N:");scanf("%c",&Yes_No);}/*增加顾客*/if(Yes_No=='Y'||Yes_No=='y'){printf("\n输入你的名字:");scanf("%s",name);printf("\n输入你的租赁天数:");scanf("%d",&day);}No=rand()%60+200;carPtr=delCar(type);cli=(client *)malloc(sizeof(client));cli->No=No;strcpy(cli->Name,name);cli->License=type;cli->carNo=carPtr->No;cli->Day=day;cli->DelayDay=0;cli->next=NULL;addCli(cli);/*移出一辆车*/printf("\n你的顾客编号是:%d",No);printf("\n你所租赁的汽车是%c类车,车号是:%d",type,carPtr->No); printf("\n你的租赁天数是%d天.",day);}void giveback(){int No;long int payment;client *ptr;printf("\n\n顾客编号:");scanf("%d",&No);if((ptr=delCli(No))==NULL)printf("\n该顾客不存在,无法归还!");else{switch(ptr->License){case 1:payment=ptr->Day*400+ptr->DelayDay*600;break;case 2:payment=ptr->Day*300+ptr->DelayDay*500;break;case 3:payment=ptr->Day*200+ptr->DelayDay*400;break; default:;}printf("\n\n顾客姓名:%s",ptr->Name);printf("\n驾照类型:%c",ptr->License);printf("\n租赁车号:%d",ptr->carNo);printf("\n租赁天数:%d",ptr->Day);printf("\n延迟天数:%d",ptr->DelayDay);printf("\n\n所需费用:%ld",payment);addCar(ptr->License,ptr->carNo);free(ptr);}}void addCar(char carType,int carNo){car *ptr;int index=carType-65;ptr=headNode[index].head;if(ptr==NULL){ptr=(car *)malloc(sizeof(car));headNode[index].head=ptr;}else{while(ptr->next)ptr=ptr->next;ptr->next=(car *)malloc(sizeof(car));ptr=ptr->next;}ptr->No=carNo;ptr->Type=carType;ptr->Payment= pay[index];ptr->fine=fine[index];ptr->next=NULL;}car* delCar(char type){car *rentcar;switch(type){case 'A':rentcar=headNode[0].head;headNode[0].head=rentcar->next;break;case 'B':rentcar=headNode[1].head; headNode[1].head=rentcar->next; break;case 'C':rentcar=headNode[2].head; headNode[2].head=rentcar->next; break;default:;}return rentcar;}void Exit(){printf("\n欢迎使用.....8886666...."); exit(0);}。
摘要汽车租赁重要是针对租赁车行开发旳管理软件,重要是将原来旳手写合同、表单、结算单通过软件管理来实现,有效防止人为旳修改。
同步将客户资料,车辆信息输入到计算机中,通过调用车辆客户信息,生成合同合同,提高了操作员旳工作效率。
系统旳核心模块是业务解决,其中涉及车辆租赁、车辆归还、车况具体信息、多种单据旳解决及报警管理。
系统重要采用Visual Basic6.0程序设计,并且运用Access数据库建立若干个表,再用VB中邦定工具,ADO等其他工具对数据进行操作,以便实现顾客对系统旳管理。
文章重要涉及对系统进行具体旳概述和对开发工具进行了简单旳简介。
对系统旳技术、经济、操作等方面旳可行性进行了分析以及需求分析。
对系统整体进行设计。
对数据库旳设计。
描述了各个功能模块旳具体设计。
测试用例及成果分析。
核心词:汽车租赁管理系统;合同;车辆归还AbstractThe automobile leasing mainly is the management software that aims at the leasing garage development, mainly is pass original handwritten contract,form and list,the balance of accounts list the software management to carry out, preventfrom effectively artificial of modification.In the meantime customer's data, the vehicle information inputs a calculator, passing to adjust to use the vehicle customer's information, born contract agreement, raise the work efficiency of the operator.The core mold piece of the system is the business processing, including a vehicle leasing, vehicle to return among them, the car condition is detailed the processing ofwithinformation, various voucher and report to the police a management.The system mainly adopts Visual Basic6.0 program designs, and make use of the Access database to build up some forms, settle other tool logarithmses, such as, tool, and ADO etc.s with the nation in VB again according to carry on an operation, in order to carry out a customer's management for system.The article includes mainly to the system to carry on detailed of said all with folio to deliver tool to carry on simple introduction. Carried on analysis and need analysis to the possibility of with technique, economy, operation...etc. of the system. It is whole to carry on a design to the system.To the design of the database.Describe the detailed design of each function mold piece.The test uses the example and the result analysis.Keywords: The automobile leasing management system; Negotiate; The vehiclereturn目录第1章概述错误!未定义书签。
汽车租赁管理系统c 课程设计一、课程目标知识目标:1. 学生能理解汽车租赁管理系统的基本概念和功能需求,掌握系统的模块划分和设计原理。
2. 学生能运用数据库知识,设计出合理、高效的汽车租赁数据模型,实现对租赁信息的增删改查等操作。
3. 学生掌握C语言编程技巧,能实现汽车租赁管理系统的核心功能,如车辆租赁、归还、查询等。
技能目标:1. 学生具备分析实际问题的能力,能根据需求进行系统设计和模块划分。
2. 学生能运用数据库知识,独立设计并实现汽车租赁数据模型,提高数据处理的效率。
3. 学生通过编写C语言代码,提高编程实践能力,熟练掌握系统功能的实现。
情感态度价值观目标:1. 学生培养对计算机编程和数据库技术的兴趣,激发学习主动性和创新精神。
2. 学生在项目实践中,学会团队协作和沟通,培养解决问题的能力和自信心。
3. 学生通过学习汽车租赁管理系统,认识到信息技术在生活中的应用,增强社会责任感和使命感。
课程性质:本课程为高年级计算机科学与技术专业的实践课程,旨在培养学生的实际编程能力和系统设计能力。
学生特点:学生具备一定的C语言编程基础和数据库知识,具备分析问题和解决问题的能力。
教学要求:教师需引导学生结合实际需求进行系统设计,注重实践操作和团队协作,提高学生的编程能力和解决问题的能力。
同时,关注学生的情感态度价值观的培养,使学生在课程中充分体现个人价值。
通过分解课程目标为具体的学习成果,便于后续教学设计和评估。
二、教学内容1. 系统需求分析:讲解汽车租赁管理系统的功能需求,分析系统模块划分,学习需求分析方法和技巧。
相关教材章节:第1章 系统分析与设计概述2. 数据库设计:介绍数据库设计原理,指导学生设计汽车租赁数据模型,包括表结构、关系和索引等。
相关教材章节:第3章 数据库设计基础3. C语言编程基础:复习C语言基础知识,重点讲解指针、结构体、文件操作等在系统中的应用。
相关教材章节:第2章 C语言基础4. 系统功能实现:指导学生运用C语言编程实现汽车租赁管理系统的核心功能,如租赁、归还、查询等。