毕业设计管理系统设计说明书_第1页
毕业设计管理系统设计说明书_第2页
毕业设计管理系统设计说明书_第3页
毕业设计管理系统设计说明书_第4页
毕业设计管理系统设计说明书_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、. .工程一:毕业设计管理系统C+工程设计说明书毕业设计管理系统设计说明书1 系统设计要求1、根本要求: (1)要求利用面向对象的方法以及C+的编程思想来完成系统的设计; (2)要求在设计的过程中,建立清晰的类层次; (3)在系统中至少要定义四个类,每个类中要有各自的属性和方法; 2、创新要求: 在根本要求到达后,可进展创新设计,如根据查找结果进展修改的功能及设计出比较友好的界面等。 2 设计思路完成主函数根本框架的编写,列出所需函数的声明,确定程序的根本功能利用vector矢量存放信息,并完成信息输出与读取功能 建立Student基类,然后 派生出四个类确定基类的数据与函数成员,并在派生类中

2、继承,完成成员函数编写分工完成各个功能的函数的编写,完成后进展组合与调试,讨论修改到达根本要求后,开场进展创新设计,添加根据查找结果修改的功能,并对界面进展优化,使之变得更友好进展压力测试,输入不同数据测试程序,并根据结果不断进展修改3 系统功能模块图 显示全学生信息查找并修改学生信息根据查找结果修改的功能创新功能添加学生信息添加本科生信息添加第二学位学生信息添加硕士研究生信息添加博士研究生信息 删除学生信息 清 屏用户选择 退出系统 提升学生级别4 类的层次图包括类成员列表数据成员学生号编号:iId*:strName年级:strGrade班级:strClass级别:strRank论文题目:s

3、trTitle分数:strMark教师:strTeacher函数成员SetId,GetIdSetName,GetNameSetGrade,GetGradeSetClass,GetClassSetRank,GetRankSetTitle,GetTitleSetMark,GetMarkSetTeacher,GetTeacherUnderGraduateSecondDegreeMasterDoctor基类:Student四个派生类学生信息类:PersonInfo5 调试过程1. 在编写类时边写边调试,防止出现低级错误;2. 确定函数的根本框架,分工边写好函数后,组合调试,测试系统功能;3. 进展创新

4、功能的设计,不断调试功能,使其更加完善;4. 根本完成系统后进展压力测试以及友好界面的设计阶段,不断调试,是系统功能更加 完美;5. 具体问题解决:在实验过程中,我们遇到了一个严重问题输入学生信息时,我们输入的第一个信息永远输不进去;最后一个信息也终究显示不出来。这个问题困扰了我们整整一个下午,因为当时觉得程序代码太多,我们自认为用调试功能为免显得繁琐。所以只是目测追究。可是,我们最终还是找不出错误。虽然,我们可以确定是哪一个程序段函数出现了问题。最终,我们用上了debug。首先,我们入手遇到了很大的麻烦。比方说,遇到点击进入函数时,出现的是那种陌生的代码。随着课堂的记忆,我们选择跳出,然在重

5、新进入,这时,我们就重新叫道了熟悉的代码。我们的调试过程也开场边得娴熟起来。后来,发现,我们出现的错误是那种缓存的错误。程序逻辑上是没有问题的,我们不可能目测发现错误。6 总结在这次C+的大工程的过程中,我们深刻地体会到了团队合作的重要性,团队分工明确,遇到问题共同解决是一个团队完成一个工程的关键所在。虽然工程中用到的一些我们还没有学到的知识,不够经过我们的学习,已经掌握了工程所需要的根本知识,并最终完成工程的编写;在编写工程过程中,我们谨遵教师平时的谆谆教诲,保持良好的编程格式,代码层次清晰,并且我们在必要的地方加上了注释,易于教师读懂。然后,通过本次工程设计,我们深知知识学得越多,程序编起

6、来就越容易,思维会更敏捷。虽然理论上C+课程已经完毕。但我们知道还有很多的知识需要我们去追求,去获得。我们发现,随着我们深入下去,我们现在学的知识是多么的浅薄,是多么的根底。C+课程只是给了我们一个开端,我们今后仍需不断地走下去。附:程序代码1.StudentGraduateSys.h#include "UnderGraduate.h"#include "SecondDegree.h"#include "Master.h"#include "Doctor.h"#include "PersonInfo.h&

7、quot;#include <vector>using namespace std;/ 从文件中加载学生个人信息bool LoadPersonInfo(vector<PersonInfo>& vecPersonInfo);/ 一次只存放一个学生信息到文件中去bool SaveOnePersonInfo(PersonInfo& person);/ 显示学生个人信息void DisplayPersonInfo(vector<PersonInfo>& vecPersonInfo);/ 添加记录/ 添加一个本科生的个人信息void AddUn

8、derGraduate(UnderGraduate& undergraduate);/ 添加一个第二学位学生的个人信息void AddSecondDegree(SecondDegree& seconddegree);/ 添加一个硕士研究生的个人信息void AddMaster(Master& master);/ 添加一个博士研究生的个人信息void AddDoctor(Doctor& doctor);/ 退出系统void Exit();2.StudentGraduateSys.cpp#include <iostream>#include<iom

9、anip>#include <vector>#include <fstream>#include "StudentGraduateSys.h"using namespace std;static int count=0; /定义全局静态变量用于设置学号int main(void)int choice = 0;vector<PersonInfo> vecPersonInfo;PersonInfo tempPersonInfo;LoadPersonInfo(vecPersonInfo);vector<int> vecSort

10、;vector<PersonInfo>:iterator it = vecPersonInfo.begin();vector<PersonInfo>:iterator array12; /用于作为vector的迭代子vecPersonInfo.clear(); /去除原有剩余信息while (1)cout<<""<<endl;cout<<" 请输入选项:"<<endl;cout<<" 1. 添加一个本科生的信息."<<endl;cout&l

11、t;<" 2. 添加一个第二学位学生的信息."<<endl;cout<<" 3. 添加一个硕士研究生的信息."<<endl;cout<<" 4. 添加一个博士研究生的信息."<<endl;cout<<" 5. 显示全部学生信息."<<endl;cout<<" 6. 查找并修改学生信息."<<endl;cout<<" 7. 提升学生级别."<<

12、;endl;cout<<" 8. 删除学生信息."<<endl;cout<<" 9. 清屏."<<endl;cout<<"10. 退出系统."<<endl;cout<<""<<endl;cin>>choice;UnderGraduate tempUnderGraduate;SecondDegree tempSecondDegree;Master tempMaster;Doctor tempDoctor;swi

13、tch(choice)case 1:/ 添加一个本科生的个人信息count+;arraycount=vecPersonInfo.begin()+count-1;AddUnderGraduate(tempUnderGraduate);tempPersonInfo.SetId(tempUnderGraduate.GetId();tempPersonInfo.SetName(tempUnderGraduate.GetName();tempPersonInfo.SetGrade(tempUnderGraduate.GetGrade();tempPersonInfo.SetClass(tempUnder

14、Graduate.GetClass();tempPersonInfo.SetRank(tempUnderGraduate.GetRank();tempPersonInfo.SetTitle(tempUnderGraduate.GetTitle();tempPersonInfo.SetTeacher(tempUnderGraduate.GetTeacher();tempPersonInfo.SetMark(tempUnderGraduate.GetMark();vecPersonInfo.push_back(tempPersonInfo);SaveOnePersonInfo(tempPerson

15、Info);break;case 2:/ 添加一个第二学位学生的个人信息count+;arraycount=vecPersonInfo.begin()+count-1;AddSecondDegree(tempSecondDegree);tempPersonInfo.SetId(tempSecondDegree.GetId();tempPersonInfo.SetName(tempSecondDegree.GetName();tempPersonInfo.SetGrade(tempSecondDegree.GetGrade();tempPersonInfo.SetClass(tempSecond

16、Degree.GetClass();tempPersonInfo.SetRank(tempSecondDegree.GetRank();tempPersonInfo.SetTitle(tempSecondDegree.GetTitle();tempPersonInfo.SetTeacher(tempSecondDegree.GetTeacher();tempPersonInfo.SetMark(tempSecondDegree.GetMark();vecPersonInfo.push_back(tempPersonInfo);SaveOnePersonInfo(tempPersonInfo);

17、break;case 3:/ 添加一个硕士研究生的个人信息count+;arraycount=vecPersonInfo.begin()+count-1;AddMaster(tempMaster);tempPersonInfo.SetId(tempMaster.GetId();tempPersonInfo.SetName(tempMaster.GetName();tempPersonInfo.SetGrade(tempMaster.GetGrade();tempPersonInfo.SetClass(tempMaster.GetClass();tempPersonInfo.SetRank(te

18、mpMaster.GetRank();tempPersonInfo.SetTitle(tempMaster.GetTitle();tempPersonInfo.SetTeacher(tempMaster.GetTeacher();tempPersonInfo.SetMark(tempMaster.GetMark();vecPersonInfo.push_back(tempPersonInfo);SaveOnePersonInfo(tempPersonInfo);break;case 4:/ 添加一个博士研究生的个人信息count+;arraycount=vecPersonInfo.begin(

19、)+count-1;AddDoctor(tempDoctor);tempPersonInfo.SetId(tempDoctor.GetId();tempPersonInfo.SetName(tempDoctor.GetName();tempPersonInfo.SetGrade(tempDoctor.GetGrade();tempPersonInfo.SetClass(tempDoctor.GetClass();tempPersonInfo.SetRank(tempDoctor.GetRank();tempPersonInfo.SetTitle(tempDoctor.GetTitle();te

20、mpPersonInfo.SetTeacher(tempDoctor.GetTeacher();tempPersonInfo.SetMark(tempDoctor.GetMark();vecPersonInfo.push_back(tempPersonInfo);SaveOnePersonInfo(tempPersonInfo);break;case 5:/ 显示全部学生个人信息cout<<"全部的学生的信息为:"<<endl;DisplayPersonInfo(vecPersonInfo);break;case 6:/ 查找学生信息int id;c

21、out<<"输入要查找的学生编号:"cin>>id;/判断是否存在此学生的信息if(id<=count)cout<<"存在该学生的信息!信息如下:"<<endl;cout<<"|ID|Name|Grade|lass|Rank|Title|TeacherMark |"<<endl;cout<< "| " << arrayid->GetId() << " |"cout<<

22、; setw(7)<< arrayid->GetName() << " |" ;cout<< setw(7)<< arrayid->GetGrade() << " |" ;cout<< setw(7)<< arrayid->GetClass() << " |" ;cout<< setw(7)<< arrayid->GetRank() << " |" ;cout&

23、lt;< setw(12)<< arrayid->GetTitle()<< " |" ;cout<< setw(9)<< arrayid->GetTeacher()<< " |" ;cout<< setw(5)<<arrayid->GetMark()<<" |" <<endl;/创新设计-根据查找结果进展修改的功能int isChange;cout<<"是否要修改该学生的信息?(需要

24、-请输入1,不需要-请输入2)"<<endl;cin>>isChange;switch(isChange)case 1:sign: /goto语句的标识int type;cout<<"请输入要修改的信息选项:1.*; 2.年级; 3.班级; 4.等级; 5.论文题目; 6.指导教师; 7.成绩"<<endl;cin>>type;switch(type)case 1:string strTemp;cout<<"请输入新信息:"getline(cin,strTemp);getl

25、ine(cin,strTemp);arrayid->SetName(strTemp);cout<<"修改成功!"<<endl;break;case 2:string strTemp;cout<<"请输入新信息:"getline(cin,strTemp);getline(cin,strTemp);arrayid->SetGrade(strTemp);cout<<"修改成功!"<<endl;break;case 3:string strTemp;cout<<

26、;"请输入新信息:"getline(cin,strTemp);getline(cin,strTemp);arrayid->SetClass(strTemp);cout<<"修改成功!"<<endl;break;case 4:string strTemp;cout<<"请输入新信息:"getline(cin,strTemp);getline(cin,strTemp);arrayid->SetRank(strTemp);cout<<"修改成功!"<<

27、;endl;break;case 5:string strTemp;cout<<"请输入新信息:"getline(cin,strTemp);getline(cin,strTemp);arrayid->SetTitle(strTemp);cout<<"修改成功!"<<endl;break;case 6:string strTemp;cout<<"请输入新信息:"getline(cin,strTemp);getline(cin,strTemp);arrayid->SetTeach

28、er(strTemp);cout<<"修改成功!"<<endl;break;case 7:string strTemp;cout<<"请输入新信息:"getline(cin,strTemp);getline(cin,strTemp);arrayid->SetMark(strTemp);cout<<"修改成功!"<<endl;break;default:cout<<"Error input!"<<endl;break;cout&

29、lt;<"继续修改请选1,查看修改后信息请选2,退出请选3;"<<endl;int ch;cin>>ch;switch(ch)case 1:goto sign;case 2:cout<<"存在该学生的信息!信息如下:"<<endl;cout<<"|ID|Name|Grade|Class|Rank|Title| Teacher |Mark |"<<endl;cout<< "| " << arrayid->Get

30、Id() << " |"cout<< setw(7)<<arrayid->GetName() << " |" ;cout<< setw(7)<<arrayid->GetGrade() << " |" ;cout<< setw(7)<< arrayid->GetClass() << " |" ;cout<< setw(7)<< arrayid->Get

31、Rank() << " |" ;cout<< setw(12)<<arrayid->GetTitle()<< " |" ;cout<<setw(9)<<arrayid->GetTeacher()<<" |" ;cout<< setw(5)<<arrayid->GetMark()<<" |" <<endl;cin.get();cin.get();break;case 3

32、:default:break;break;case 2: default: break;elsecout<<"不存在此学生的信息!"<<endl;break;case 7:/ 提升学生级别int id;cout<<"输入要提升级别的学生编号:"cin>>id;/判断是否存在此学生的信息if(id<=count)cout<<arrayid->GetName()<<"的级别是:"<<arrayid->GetRank()<<en

33、dl;string strTemp;cout<<"请输入提升后的级别:"getline(cin,strTemp);getline(cin,strTemp);arrayid->SetRank(strTemp);cout<<"提升级别成功!"<<endl;elsecout<<"不存在此学生的信息!"<<endl;break;case 8:/ 删除学生个人信息int id;cout<<"输入要删除的学生的学生编号:"cin>>id;

34、/判断是否存在此学生的信息if(id<=count)vecPersonInfo.erase(arrayid);cout<<arrayid->GetName<<"的信息已经被删除!"<<endl;elsecout<<"不存在此学生的信息!"<<endl;break;case 9:/ 清屏system("cls");break;case 10:/ 退出系统Exit();break;default:cout<<"Error input!"

35、<<endl;break;system("PAUSE");return 0;/ 从文件中加载学生个人信息bool LoadPersonInfo(vector<PersonInfo>& vecPersonInfo)fstream file;file.open("personInfo.txt",ios:in);if (!file.is_open()cout<<"The file is not exist!"<<endl;return false;PersonInfo tempPers

36、onInfo;while (!file.eof()fflush(stdin);char strTemp30;file.getline(strTemp,30);if (strTemp0 = '0')break;tempPersonInfo.SetId(atoi(strTemp);file.getline(strTemp,30);tempPersonInfo.SetName(strTemp);file.getline(strTemp,30);tempPersonInfo.SetGrade(strTemp);file.getline(strTemp, 30);tempPersonIn

37、fo.SetClass(strTemp);file.getline(strTemp, 30);tempPersonInfo.SetRank(strTemp);file.getline(strTemp, 30);tempPersonInfo.SetTitle(strTemp);file.getline(strTemp, 30);tempPersonInfo.SetTeacher(strTemp);file.getline(strTemp, 30);tempPersonInfo.SetMark(strTemp);vecPersonInfo.push_back(tempPersonInfo);ret

38、urn true;/ 一次只存放一个学生信息到文件中去bool SaveOnePersonInfo(PersonInfo& person)fstream file;file.open("personInfo.txt", ios:app|ios:out);if (!file.is_open()cout<<"The file is not exist!"<<endl;return false;file<<person.GetId()<<endl;file<<person.GetName()&

39、lt;<endl;file<<person.GetGrade()<<endl;file<<person.GetClass()<<endl;file<<person.GetRank()<<endl;file<<person.GetTitle()<<endl;file<<person.GetTeacher()<<endl;file<<person.GetMark()<<endl;file.close();return true;/ 显示学生个人信息v

40、oid DisplayPersonInfo(vector<PersonInfo>& vecPersonInfo)vector<PersonInfo>:iterator it = vecPersonInfo.begin();cout<<""<<endl;cout<<"| ID | Name | Grade | Class| Rank | Title | Teacher | Mark|"<<endl;for (;it!=vecPersonInfo.end(); it+)cout&

41、lt;< "| " << it->GetId() << " |"cout<< setw(7)<< it->GetName() << " |" ;cout<< setw(7)<< it->GetGrade() << " |" ;cout<< setw(7)<< it->GetClass() << " |" ;cout<< se

42、tw(7)<< it->GetRank() << " |" ; cout<< setw(12)<< it->GetTitle()<< " |" ;cout<< setw(9)<< it->GetTeacher()<< " |" ;cout<< setw(5)<<it->GetMark()<<" |" <<endl;cout<<"

43、"<<endl;/退出系统void Exit()cout<<"系统已经关闭!"<<endl;system("PAUSE");exit(-1);/添加一个本科生的个人信息void AddUnderGraduate(UnderGraduate& tempUnderGraduate)string strTemp;cout<<"请输入本科生的信息:"<<endl;cout<<"学生编号:"<<count<<en

44、dl;tempUnderGraduate.SetId(count);cout<<endl;cout<<"*:"getline(cin, strTemp);getline(cin, strTemp);tempUnderGraduate.SetName(strTemp);cout<<"年级:"getline(cin, strTemp);getline(cin, strTemp);tempUnderGraduate.SetGrade(strTemp);cout<<"班级:"getline(ci

45、n, strTemp);getline(cin, strTemp);tempUnderGraduate.SetClass(strTemp);cout<<"级别:"getline(cin, strTemp);getline(cin, strTemp);tempUnderGraduate.SetRank(strTemp);cout<<"论文题目:"getline(cin, strTemp);getline(cin, strTemp);tempUnderGraduate.SetTitle(strTemp);cout<<&qu

46、ot;指导教师:"getline(cin, strTemp);getline(cin, strTemp);tempUnderGraduate.SetTeacher(strTemp);cout<<"成绩:"getline(cin, strTemp);getline(cin, strTemp);tempUnderGraduate.SetMark(strTemp);/添加一个第二学位学生的个人信息void AddSecondDegree(SecondDegree& tempSecondDegree)string strTemp;cout<<

47、;"请输入第二学位学生的信息:"<<endl;cout<<"学生编号:"<<count<<endl;tempSecondDegree.SetId(count);cout<<endl;cout<<"*:"getline(cin, strTemp);getline(cin, strTemp);tempSecondDegree.SetName(strTemp);cout<<"年级:"getline(cin, strTemp);getlin

48、e(cin, strTemp);tempSecondDegree.SetGrade(strTemp);cout<<"班级:"getline(cin, strTemp);getline(cin, strTemp);tempSecondDegree.SetClass(strTemp);cout<<"级别:"getline(cin, strTemp);getline(cin, strTemp);tempSecondDegree.SetRank(strTemp);cout<<"论文题目:"getline(c

49、in, strTemp);getline(cin, strTemp);tempSecondDegree.SetTitle(strTemp);cout<<"指导教师:"getline(cin, strTemp);getline(cin, strTemp);tempSecondDegree.SetTeacher(strTemp);cout<<"成绩:"getline(cin, strTemp);getline(cin, strTemp);tempSecondDegree.SetMark(strTemp); /添加一个硕士研究生的个人信

50、息void AddMaster(Master& tempMaster)string strTemp;cout<<"请输入硕士研究生的信息:"<<endl;cout<<"学生编号:"<<count<<endl;tempMaster.SetId(count);cout<<endl;cout<<"*:"getline(cin, strTemp);getline(cin, strTemp);tempMaster.SetName(strTemp);cou

51、t<<"年级:"getline(cin, strTemp);getline(cin, strTemp);tempMaster.SetGrade(strTemp);cout<<"班级:"getline(cin, strTemp);getline(cin, strTemp);tempMaster.SetClass(strTemp);cout<<"级别:"getline(cin, strTemp);getline(cin, strTemp);tempMaster.SetRank(strTemp);cout

52、<<"论文题目:"getline(cin, strTemp);getline(cin, strTemp);tempMaster.SetTitle(strTemp);cout<<"指导教师:"getline(cin, strTemp);getline(cin, strTemp);tempMaster.SetTeacher(strTemp);cout<<"成绩:"getline(cin, strTemp);getline(cin, strTemp);tempMaster.SetMark(strTemp)

53、;/添加一个博士研究生的个人信息void AddDoctor(Doctor& tempDoctor)string strTemp;cout<<"请输入博士研究生的信息:"<<endl;cout<<"学生编号:"<<count<<endl;tempDoctor.SetId(count);cout<<endl;cout<<"*:"getline(cin, strTemp);getline(cin, strTemp);tempDoctor.SetNa

54、me(strTemp);cout<<"年级:"getline(cin, strTemp);getline(cin, strTemp);tempDoctor.SetGrade(strTemp);cout<<"班级:"getline(cin, strTemp);getline(cin, strTemp);tempDoctor.SetClass(strTemp);cout<<"级别:"getline(cin, strTemp);getline(cin, strTemp);tempDoctor.SetRan

55、k(strTemp);cout<<"论文题目:"getline(cin, strTemp);getline(cin, strTemp);tempDoctor.SetTitle(strTemp);cout<<"指导教师:"getline(cin, strTemp);getline(cin, strTemp);tempDoctor.SetTeacher(strTemp);cout<<"成绩:"getline(cin, strTemp);getline(cin, strTemp);tempDoctor.SetMark(strTemp);3. Student.h#include<string>using namespace std;class Student prot

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论