基于C++的车辆信息管理系统.docxVIP

  • 18
  • 0
  • 约4.14千字
  • 约 16页
  • 2021-04-21 发布于山东
  • 举报
哈尔滨理工大学 软件学院 课程实践报告 课程设计 C++ 课程实践 题 目 车辆信息管理 班 级 软件 15- 7 学 生 *** 学 号 *** 指导教师 *** 管理系统的功能说明 1. 存储数据的描述 2. 概要设计说明书 3. 源程序 4. 测试分析(用户操作手册) 5. 总结报告 管理系统功能说明 车辆管理系统有五项功能: 一 . 增加车辆信息 二 . 浏览所有的车辆信息 . 查询车辆信息(按车辆品牌和型号) 四 . 修改车辆信息(通过型号查找再修改) 五 . 退出系统 存储数据的描述 由于本学期 c++关于类的知识学的不精,我定义的是上学期学习的结构 体,并利 用文件 存储 fopen 与 fclose 产生 一个名 为 information 的 txt 文件存储数据,方便程序的读写。 概要设计说明书 系统初始界面并初始化 数据内存。 对用户要求做出反应: 浏览 增加 查找 修改 退出  退出 2. 浏览 依次输出 车辆信息 1. 利用指针 将存储地址 传给参数, 储存数据  对 查 找 类型进行 选择。 输入查找内容, 与对 应信息类型内数据 进行逐个比对, 相同 返回对应地址。  对对应地址 的信息进行修 改 对应地址信息 进行输出 源程序 #includeiostream #include #include #include using namespace std; typedef struct car { char Brand[20]; char Model[20]; char Manufacturar[20]; 立车辆信息 .endl2. 浏览车辆信 息.endl; cout3. 查 询 车 辆 信 息 .endl4. 修 改 车 辆 信 息.endl5. 退出管理系统 . endl 请选择 :endl; cini; if(i=0||i5) { cout 数字错误 , 请重新输入 !endlendl; goto mainint; } switch(i) { case 1: shuru(s); break; case 2: shuchu(s); putfile(s); break; case 3: find(s); break; case 4: change(s); break; case 5: cout 感谢使用 endl; exit(0); } } } int init(cheliang s) { s=(cheliang)malloc(sizeof(car)); 品牌查找 .endl2. 按 型号查找 .endl; cout 请选择 :; int k; cink; if(k0||k2) { cout 请输入正确数字 endlendl; goto findl; } switch(k) { case 1: findBrand(s); break; case 2: findModel(s); break; } } void findBrand(cheliang s) //find by name { cheliang p; p=s-next; cout 请输入品牌: ; char Brand[20]; int j; j=0; cinBrand; cout 你要查找的资料是 :endl; cout  品牌   型号  厂家   价格   联系人 endl; while(p) { if (strcmp(p-Brand,Brand)==0) { coutp-Brand p-Model p-Manufacturar p-Price p-Linkman endl; j++; } p=p-next; } coutendl; if(j==0) cout 厂家错误 !endlendl ; } void findModel(cheliang s) //find by number { cheliang p; p=s-next; cout 请输入型号: ; char Model[20]; int j; j=0; cinModel; cout 你要查找的资料是 :endl; cout 品牌 型号 厂家 价格 联系人 endl; while(p) { if (strcmp(p-Model,Model)==0) { coutp-Brand p-Model p-Manufacturar p-Price p-Linkman endl; j++; } p=p-next; } coutendl; if(j==0) cout 对不起 , 没这车。 endlendl ; } void change(cheliang s) //modifay { cheliang q,p,l,m; int j; j=

文档评论(0)

1亿VIP精品文档

相关文档