欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    2 设计学生信息管理系统.docx

    • 资源ID:10155211       资源大小:24.46KB        全文页数:53页
    • 资源格式: DOCX        下载积分:3金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    2 设计学生信息管理系统.docx

    1、2 设计学生信息管理系统 2设计学生信息管理系统 源程序代码/*/程序共有11个文件组成,五个类分别有头文件和实现文件,另外有一个主函数文件。1 Subject.h文件#if !defined(AFX_SUBJECT_H_3001776D_2E6A_4292_96F6_EF8525844C9E_INCLUDED_)#define AFX_SUBJECT_H_3001776D_2E6A_4292_96F6_EF8525844C9E_INCLUDED_#if _MSC_VER 1000#pragma once#endif / _MSC_VER 1000#include #include #incl

    2、ude #include #include class Subject public: Subject * next; float fenshu; int Crect; char teacher12; char Cname12; char Cno5; Subject(); Subject(char *name,char *no,char *teacher1,int crect1,float fenshu1) strcpy(Cname,name); strcpy(Cno,no); strcpy(teacher,teacher1); Crect= crect1; fenshu= fenshu1;

    3、next=NULL; virtual Subject(); friend ostream &operator (ostream &oc,Subject &obj); /重载(istream &ic,Subject &obj); /重载;#endif / !defined(AFX_SUBJECT_H_3001776D_2E6A_4292_96F6_EF8525844C9E_INCLUDED_)/*/2 Student.h文件#if !defined(AFX_STUDENT_H_4392E0A8_A0E9_4353_968C_F57DB538B90A_INCLUDED_)#define AFX_S

    4、TUDENT_H_4392E0A8_A0E9_4353_968C_F57DB538B90A_INCLUDED_#if _MSC_VER 1000#pragma once#endif / _MSC_VER 1000#include #include #include #include #include #include Subject.hclass Student public: void DispAll(); Subject *Sub; int SubCount; Student * next; int Sage; int Sgrade; char Ssex4; char Pno5; char

    5、 Cname10; char Sname10; char Sno10; Student(); Student(char *no,char *name,char *pno1,char *cname1,int grade1,char *sex,int age) next=NULL; Sub= NULL; SubCount = 0; strcpy(Sno,no); strcpy(Sname,name); strcpy(Pno,pno1); strcpy(Cname,cname1); Sgrade= grade1; strcpy(Ssex,sex); Sage= age; Student(); boo

    6、l AddSub(char* name,char* no,char* teacher,int crect,float fenshu); Subject* FindSub(char* no); bool DelSub(char* no); float AvgFenShu(); float MaxFenShu(); float MinFenShu(); friend ostream &operator (ostream &oc,Student &obj); /重载(istream &ic,Student &obj); /重载;#endif / !defined(AFX_STUDENT_H_4392

    7、E0A8_A0E9_4353_968C_F57DB538B90A_INCLUDED_)/*/3 Class.h文件#if !defined(AFX_LASS_H_CFFEE7B4_31E2_4F10_BA58_38D8D461130E_INCLUDED_)#define AFX_LASS_H_CFFEE7B4_31E2_4F10_BA58_38D8D461130E_INCLUDED_#if _MSC_VER 1000#pragma once#endif / _MSC_VER 1000#include Student.hclass Class public: void StudMenu(Stud

    8、ent* studType); void DispAll(); char Pno5; char Cname10; char Cno5; int StudCount; Class *next; Student *Stud; Class(); Class(char *cno1,char *cname1,char *pno1) next= NULL; Stud=NULL; StudCount = 0; strcpy(Cno,cno1); strcpy(Cname,cname1); strcpy(Pno,pno1); virtual Class(); bool AddStud(char *no,cha

    9、r *name,char *pno,char *cname,int grade,char *sex,int age); bool DeleteStud(char *no); Student * FindStud(char *no); friend ostream &operator (ostream &oc,Class &obj); /重载(istream &ic,Class &obj); /重载;#endif / !defined(AFX_LASS_H_CFFEE7B4_31E2_4F10_BA58_38D8D461130E_INCLUDED_)/*/4 Department.h文件#if

    10、!defined(AFX_DEPANTMENT_H_A6895DC1_C3F3_4737_88EC_AE2DA280272E_INCLUDED_)#define AFX_DEPANTMENT_H_A6895DC1_C3F3_4737_88EC_AE2DA280272E_INCLUDED_#if _MSC_VER 1000#pragma once#endif / _MSC_VER 1000#include lass.hclass Department public: void ClaMenu(Class *ClaType); void DispAll(); char Pname10; char

    11、Pno5; int ClaCount; Department *next; Class *Cla; Department(); Department(char *Pno1,char *Pname1) next= NULL; Cla=NULL; ClaCount = 0; strcpy(Pno,Pno1); strcpy(Pname,Pname1); virtual Department(); bool AddClass(char *cno,char *cname,char *pno); bool DeleteClass(char *no); Class * FindsClass(char *n

    12、o); friend ostream &operator (ostream &oc,Department &obj); /重载(istream &ic,Department &obj); /重载;#endif / !defined(AFX_DEPANTMENT_H_A6895DC1_C3F3_4737_88EC_AE2DA280272E_INCLUDED_)/*/5 School.h文件#if !defined(AFX_SCHOOL_H_7D278A4A_44F9_45A2_B3D6_35306E25BEFE_INCLUDED_)#define AFX_SCHOOL_H_7D278A4A_44

    13、F9_45A2_B3D6_35306E25BEFE_INCLUDED_#if _MSC_VER 1000#pragma once#endif / _MSC_VER 1000#include Depantment.hclass School public: void DepMenu(Department *depType); void DispAll(); Department *root; int DeptCount; School(); virtual School(); bool AddDept(char *pno,char *pname); bool DeleteDept(char *n

    14、o); Department * FindDept(char *no); void save(); /将班级记录存入指定文件 void load(); /从指定文件装载班级记录;#endif / !defined(AFX_SCHOOL_H_7D278A4A_44F9_45A2_B3D6_35306E25BEFE_INCLUDED_)/*/6 School.cpp文件#include School.h/ Construction/Destruction/School:School() root=NULL; DeptCount = 0;School:School() if(root!=NULL)

    15、delete root;bool School:AddDept(char *pno,char *pname) Department *temp,*old; temp= old= root; while(temp!=NULL) if(strcmp(temp-Pno,pno)=0) coutt这个系pno已经存在!next ; if(temp=NULL) Department *ptr; ptr= new Department(pno,pname); ptr-next= NULL; if (old != NULL) old-next = ptr; else root = ptr; DeptCoun

    16、t+; couttpname(pno)加入成功!Pno,no)!=0) old= temp; temp= temp-next ; else old-next= temp-next ; coutt系号为no的系已经成功删除!endl; return true; if(temp=NULL) coutt系号为no的系不存在!Pno,no)=0) coutt系号为no的系已经找到!next ; if(temp=NULL) coutt系号为no的系不存在!endl; return NULL;void School:DispAll() Department *temp; temp= root; coutt

    17、系名tt系号endl; while(temp!=NULL) couttPname ttPnonext ; void School:DepMenu(Department *depType) int sel; sel = 1; char cname10; char cno5; while(sel) coutendlendl; cout请选择您的操作:endlendl; cout 1.增加班级;endl; cout 2.查找班级;endl; cout 3.显示所有班级;endl; cout 4.删除班级;endl; cout 0.退出;endl; coutsel; cout=0 & sel=4) s

    18、witch(sel) case 1: coutcno; coutendl; coutcname; coutAddClass(cno,cname,depType-Pno); break; case 2: Class* find; cout cno; find = depType-FindsClass (cno); if (find != NULL) cout班级号:Cno endl; cout班级名称:Cname endlendl; cout1.进入此班级endl; cout其他数返回上级菜单depsel; if (depsel = 1) /班级里菜单 depType-ClaMenu (find

    19、); else break; break; case 3: coutt所有的班级信息为:DispAll (); break; case 4: coutcno; depType-DeleteClass (cno); break; case 0: break; else cout输入错误!请重新输入。; void School:save() if(root=NULL) coutt没有系记录可存!endl; return; ofstream out; out.open (school.dat,ios:out); if(!out) coutt文件不能打开!endl; return; coutt正在保存

    20、系数据.endl; Department * p; p= root; out DeptCountt; while(p!=NULL) outnext ; out.close (); couttDeptCount 条记录已经存入文件!endl;void School:load() /从指定文件装载班级记录 /先清空当前列表 if(root!=NULL) delete root; root = NULL; DeptCount = 0; ifstream in; in.open (school.dat,ios:in| ios:nocreate); if(!in) coutt文件不能打开!endl; return; coutt正在读取系数据. count; for (int i= 0;i*p; if (root = NULL) root= p; old = root; else old-next = p; old = old-next; DeptCount+; in.close (); couttDeptCount 条记录已经读取!next; delete


    注意事项

    本文(2 设计学生信息管理系统.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开