ImageVerifierCode 换一换
格式:DOCX , 页数:18 ,大小:17.45KB ,
资源ID:7348815      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/7348815.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(CC++课程设计选题管理系统.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

CC++课程设计选题管理系统.docx

1、CC+课程设计选题管理系统课程设计选题管理系统 作者:admin 日期:2008-05-23/*设计学生类;课程设计题目类(序号,题目,人数,描述);每个题目限两个人选;要求使用面向对象编程进行模拟课程设计选题;要求以链表格式存储,信息保存在文件中。主要包括下列模块:1 新增、修改、删除课程设计题目;2 新增、修改、删除学生信息;3 查询课程设计内容;4 课程设计选题;*/#include #include #include using namespace std;class Student long num; char name20; char subject30; Student *Nex

2、t; Student *Head;public: int Creat() FILE *fp; Head = NULL; /存放链表的起始地址 Student *p, *pEnd; p = new Student; /创建一个Teacher的动态对象 if(fp=fopen(Student.txt,r)=NULL) cout can not open file! num,p-name,p-subject); /输入指针p指向的对象的数据成员的值 pEnd = Head; / 存放当前对象的地址 while(!feof(fp) / 0 是输入结束的标志 if(NULL = Head) Head =

3、 p; / 只在第一次执行此语句 else pEnd-Next = p; / 存放下一个对象的地址 pEnd = p; p = new Student; /动态创建下一个对象 fscanf(fp,%ld%s%s,&p-num,p-name,p-subject); /输入下一个对象数据成员的值 pEnd-Next = NULL; return 0; int Newstudent() FILE *fp; cout 请输入增加的学生的相关信息: endl; cout num ; cout endl; cout name; cout endl; cout subject; cout endl; if(

4、fp=fopen(student.txt,a)=NULL) cout can not open file! endl; exit(0); fprintf(fp,%ld %s %sn,num,name,subject); fclose (fp); return 0; int Modify()/修改 FILE *fp; Student *p; char namer20; Creat(); cout namer; cout name) p=p-Next; if(p=NULL) break; if(p!=NULL) cout 你要修改的学生的相关信息如下: endl endl; cout num na

5、me subject endl endl; cout 请输入修改后的相关信息: endl endl; cout p-num; cout endl; cout p-name; cout endl; cout p-subject; cout endl; if(fp=fopen(Student.txt,w)=NULL) cout can not open file! num,p-name,p-subject); p=p-Next; while(p!=NULL); fclose (fp); else cout 没有找到你想要修改的题目的信息 endl; else cout 文件中还没有任何题目endl

6、; return 0; int Del()/删除 FILE *fp; Student *p,*p1; char namer30; Creat(); cout namer; cout name) p1=p; p=p-Next; if(p=NULL) break; if(p!=NULL) cout 你要删除的题目的相关信息如下: endl; cout 姓名 : name endl; cout 学号 : num endl; cout 所选题目: subject Next; else p1-Next=p-Next; if(fp=fopen(Student.txt,w)=NULL) cout can n

7、ot open file! num,p-name,p-subject); p=p-Next; while(p!=NULL); fclose (fp); cout 该学生的所有信息已被删除! endl; else cout 没有找到你想要删除的学生的信息 endl; else cout 文件中还没有任何学生的信息endl; return 0; ;class Subject/* int serial_number;/序号 char subject30; /题目 int peoples;/限定人数 int people;/已选人数 char description100;/描述 Subject *n

8、ext; Subject *head;public: int Chosesubject(); int creat(); int newsubject(); int modify(); int del(); int demand();int Subject:creat() FILE *fp; head = NULL; /存放链表的起始地址 Subject *p, *pEnd; p = new Subject; /创建一个Teacher的动态对象 if(fp=fopen(Subject.txt,r)=NULL) cout can not open file! serial_number,p-sub

9、ject,&p-peoples,p-description,&p-people); /输入指针p指向的对象的数据成员的值 pEnd = head; / 存放当前对象的地址 while(!feof(fp) / 0 是输入结束的标志 if(NULL = head) head = p; / 只在第一次执行此语句 else pEnd-next = p; / 存放下一个对象的地址 pEnd = p; p = new Subject; /动态创建下一个对象 fscanf(fp,%d%s%d%s%d,&p-serial_number,p-subject,&p-peoples,p-description,&p

10、-people); /输入下一个对象数据成员的值 pEnd-next = NULL; return 0;int Subject:newsubject()/*增加 FILE *fp; cout serial_number; cout endl; cout subject; cout endl; cout peoples; cout endl; cout description; cout endl; cout people; cout endl; if(fp=fopen(Subject.txt,a)=NULL) cout can not open file! endl; exit(0); fpr

11、intf(fp,%d %s %d %s %dn,serial_number,subject,peoples,description,people); return 0;int Subject:modify()/*修改 FILE *fp; Subject *p; char sub30; creat(); cout sub; cout subject) p=p-next; if(p=NULL) break; if(p!=NULL) cout 你要修改的题目的相关信息如下: endl; cout serial_number subject people description endl; cout

12、请输入修改后的相关信息: endl; cout p-serial_number; cout endl; cout p-subject; cout endl; cout p-peoples; cout endl; cout p-description; cout endl; cout p-people; cout endl; if(fp=fopen(Subject.txt,w)=NULL) cout can not open file! serial_number,p-subject,p-peoples,p-description,p-people); p=p-next; while(p!=NU

13、LL); fclose (fp); else cout 没有找到你想要修改的题目的信息 endl; else cout 文件中还没有任何题目endl; return 0;int Subject:del()/*删除 FILE *fp; Subject *p,*p1; char sub30; creat(); cout sub; cout subject) p1=p; p=p-next; if(p=NULL) break; if(p!=NULL) cout 你要删除的题目的相关信息如下: endl; cout 序号 : serial_number endl; cout 题目 : subject e

14、ndl; cout 限定人数: peoples endl; cout 题目描述: description endl; cout 已选人数: people next; else p1-next=p-next; if(fp=fopen(Subject.txt,w)=NULL) cout can not open file! serial_number,p-subject,p-peoples,p-description,p-people); p=p-next; while(p!=NULL); fclose (fp); cout 该题目的所有信息已被删除! endl; else cout 没有找到你想

15、要删除的题目的信息 endl; else cout 文件中还没有任何题目endl; return 0;int Subject:demand()/*查询课程设计题目 Subject *p,*p1; char sub30; creat(); cout 所有题目列表如下 endl; p=head; while(p != NULL) cout 序号: serial_number 题目 : subject endl; cout next; cout sub; cout subject) p1=p; p=p-next; if(p=NULL) break; if(p!=NULL) cout 关于该题目有如下

16、描述: endl description endl; else cout 没有找到你想要修改的题目的信息 endl; else cout 文件中还没有任何题目endl; return 0;int Subject:Chosesubject() FILE *fp; Subject *p,*p1; char sub30; creat(); cout sub; cout subject) p1=p; p=p-next; if(p=NULL) break; if(p!=NULL) if(p-people=p-peoples) cout 人数超限!你不能再选择此题目! people+; if(fp=fop

17、en(Subject.txt,w)=NULL) cout can not open file! serial_number,p-subject,p-peoples,p-description,p-people); p=p-next; while(p!=NULL); cout *选题成功!* endl; fclose (fp); else cout 没有找到你想要修改的题目的信息 endl; else cout 文件中还没有任何题目endl; return 0;int main() system(color 1d); Subject a; Student b; char choice;coutn

18、nt 欢迎使用课程设计选课系统nn; coutt1.添加新的科目n; coutt2.*删除所选内容*n; coutt3.修改课程设计信息n; coutt4.*添加新的学生的相关信息*n; coutt5.删除学生记录nnn; coutt6.*修改学生相关信息*n; coutt7.查询课程设计内容n; coutt8.*进行课程设计选课*n; coutt0.退出系统nnn; coutt *制作人:肖涛*nnn; coutt *指导老师:范永全*nnn;coutchoice; if(choice=0) exit(0);else if(choice=1) a.newsubject();system(pa

19、use);main(); else if(choice=2) a.del();system(pause); main();else if(choice=3) a.modify();system(pause);main();else if(choice=4) b.Newstudent();system(pause);main();elseif(choice=5) b.Del();system(pause);main();else if(choice=6) b.Modify();system(pause);main();else if(choice=7) a.demand();system(pause);main();else if(choice=8) a.Chosesubject();system(pause);main();else cout输入错误,请重新输入您的选择:; system(pause);main(); 文章来自: 本站原创

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1