C++课程设计报告6691514Word文档格式.docx

上传人:b****5 文档编号:16278553 上传时间:2022-11-22 格式:DOCX 页数:68 大小:33.36KB
下载 相关 举报
C++课程设计报告6691514Word文档格式.docx_第1页
第1页 / 共68页
C++课程设计报告6691514Word文档格式.docx_第2页
第2页 / 共68页
C++课程设计报告6691514Word文档格式.docx_第3页
第3页 / 共68页
C++课程设计报告6691514Word文档格式.docx_第4页
第4页 / 共68页
C++课程设计报告6691514Word文档格式.docx_第5页
第5页 / 共68页
点击查看更多>>
下载资源
资源描述

C++课程设计报告6691514Word文档格式.docx

《C++课程设计报告6691514Word文档格式.docx》由会员分享,可在线阅读,更多相关《C++课程设计报告6691514Word文档格式.docx(68页珍藏版)》请在冰豆网上搜索。

C++课程设计报告6691514Word文档格式.docx

listNode(Inform&

);

listNode(listNode&

listNode*create();

//创建链表

listNode*insert(listNode*);

//对链表进行插入操作;

listNode*del(listNode*,char*);

//删除资料中含有char*的节点;

voidprintlistNode(listNode*);

//打印链表;

~listNode();

voidsearch(char*,listNode*);

//查找链表中含有char*的学生;

listNode*modify(listNode*);

//修改

private:

Informdata;

staticintnum;

listNode*nextPtr;

};

****************************Inform.h**************************

classInform{

friendostream&

operator<

<

(ostream&

Inform&

friendistream&

operator>

>

(istream&

Inform();

Inform(Inform&

intoperator==(constInform&

intoperator==(char*);

intoperator!

=(char*);

Inform&

operator=(Inform&

~Inform();

char*number;

char*id;

char*name;

char*sex;

achieveach;

char*phonenumber;

char*roomnumber;

************************achieve.h********************************************cclassachieve{

friendostream&

output,achieve&

friendistream&

input,achieve&

achieve();

voidcountaverage(subject*);

intoperator==(achieve&

achieve&

operator=(achieve&

voidinstruction();

~achieve();

voidsetnum(inta);

intgetnum();

subject*TT;

intnum;

floatsum;

floataverage;

*******************************subject.h*************************************

classsubject{

subject&

constsubject&

subject&

operator=(constsubject&

charname[MAX1];

floatachievement;

floatxuefen;

题目2学生选修课系统

1.选修课系统学生端

完成学生选课、学生情况、选课情况、退出系统等功能的设计与实现。

2.选修课系统管理端

完成增加学生、增加课程、删除学生、删除课程、填写成绩、更改学分、学生情况、选课情况、保存数据、退出系统等功能的设计与实现。

//定义课程

structcourse//某个学生所学的课程中的某一个

{

charcname[20];

//课程名称

floatgrade;

//课程成绩

course*Next;

//指向下一个课程的指针

//学生类

classstudent

student()

{

root=NULL;

constmaxcourse=5;

factcourse=0;

}

voidreadname(charN[]);

//读入学生的姓名

voidgetname(charN[]);

//得到学生的姓名

voidwrecourse(charN[],floatscore);

//要据课程名写入学生课程的成绩

floataverage();

//学生课程的平均成绩

voidaddcourse(charN[],floatg);

//给学生增加一门课

intfindcourse(charN[]);

//查找是否已有此课程,如果有返回1,如果没有返回0

intretfactcourse()

returnfactcourse;

}//得到所学的课程数目

course*retroot()

returnroot;

//利用键表将所有的课程保存起来

intretmaxcourse()

return5;

//得到最多可学的课程数目

voidclrroot()//清零

charsname[20];

//学生的姓名

intmaxcourse;

//学生最多可以学五门课程

intfactcourse;

//学生实际所学的课程数目

course*root;

//课程的根结点指针

structstudentdb

studentstu;

studentdb*Next;

structstudentname

chartname[20];

//学生的名字

floatresult;

//学生所得的该课程分数

studentname*Next;

//课程类

classsubject

subject()

first=NULL;

maxstudent=30;

activestudnet=0;

floatreadcredit();

//得到课程的学分

voidgetcredit(floata);

//设置学分

floatgetaverage();

//得到学生的平均成绩

floatgetresult(charN[]);

//查找某个学生的成绩

voidgetkname(charN[]);

//读出课程的名称

voidsetkname(charN[]);

//读入课程的名称

voidfindstudent(studentdb*P);

//根据该课程的名称,寻找选这课程的学生

studentname*retfirst()

returnfirst;

//返回根结点

intretactivestudent()

returnactivestudnet;

//返回实际学生数

intretmaxstudent()

return30;

//返回最多学生数30

voidclractivestudnet()

activestudnet=0;

//从文件中读出来后将实际学生数清零

intmaxstudent;

//最多学生数

intactivestudnet;

//实际学生数

studentname*first;

//学生名单

floatcredit;

//该课程的学分

floataveragerusult;

//该课程的平均成绩

charkname[20];

//该课程的名称

四、课程设计文字资料要求

(1)每个同学必须独立完成自己任务的软件课程设计说明书,字数不少于2000字;

(2)不得少于300行有效代码;

(3)说明书书写规范、语句通顺、图表清晰。

(4)说明书正文前附《课程设计任务书》,《课程设计指导情况表》(此内容不在2000字范围中),一律用A4纸打印或使用学校统一的课程设计报告纸;

(5)说明书要求文字打印,统一格式,封面规范,装订成册,一式一份。

五、总结报告

学生对课程设计的全过程做出系统总结报告(《课程设计说明书》)。

课程设计说明书(正文)应包括的主要内容有:

需求分析、系统总框图、UML类图、每个模块的设计分析、列出所有定义的函数及说明、举例说明1、2个比较有特点的算法、存在的问题与不足及对策、使用说明(操作手册)、课程设计的心得和体会等,再报告的最后附上程序源代码。

六、考核

学生完成课程设计后,采用设计答辩的形式,评定学生设计水平。

每位学生必须在规定时间内完成课程设计。

指导教师要从以下几个方面加以考察:

学生软件开发基础知识掌握的程度、选定的方案及设计是否正确、独立分析问题和解决问题的能力、学生的创新精神、总结报告水平、学习态度(可从平时指导过程中考察)、科学作风、思想表现等。

对雷同报告均记为不合格报告,成绩也不合格。

教师对每一个学生做出评语,并根据以上几方面给出具体的成绩。

答辩时需提交程序源代码文档。

(提交的电子文档文件的命名方式为:

学号+姓名)

七、实间安排

1.13周星期一1、2节在

203下达课程指导书,宣布纪律;

2.辅导时间:

13~15周星期一下午、星期五上午,地点:

2号机房。

其他时间网上答疑:

zhangxiaorong.;

3.报告提交时间:

15周星期五下午,地点:

参考代码

学生学籍管理系统

//程序源代码

*****************************listNode.h**************************************

#ifndeflistNode_h

#definelistNode_h

#defineLENsizeof(listNode)

#include<

iostream.h>

stdlib.h>

assert.h>

string.h>

stdio.h>

#include"

Inform.h"

#defineMAX24

classlistNode{

#endif

*********************listNode.cpp*********************************

listNode.h"

intlistNode:

:

num=0;

listNode:

listNode(Inform&

da)

data=da;

nextPtr=newlistNode[LEN];

}

listNode(listNode&

copy)//拷贝构造函数。

data=copy.data;

assert(nextPtr!

=0);

nextPtr=copy.nextPtr;

listNode*listNode:

create()//从文件f3.txt中读入链表数据;

listNode*head=NULL;

listNode*p1,*p2;

p1=p2=newlistNode[LEN];

charch;

cout<

"

\t输入第一个学生的情况:

endl;

do

cin>

p1->

data;

num=num+1;

if(num==1)

head=p1;

else

p2->

nextPtr=p1;

p2=p1;

p1=newlistNode[LEN];

cout<

\t要继续输入吗?

(y/n):

"

;

cin>

ch;

}while(ch=='

y'

p2->

nextPtr=NULL;

\t输入学生个数为:

num<

return(head);

insert(listNode*head)//将Inform类的一个对象DATA插入链表头。

\t输入要插入的学生资料:

Informinsertdata;

cin>

insertdata;

listNode*p0,*p1;

p0=newlistNode[LEN];

assert(p0!

p0->

data=insertdata;

p1=newlistNode[LEN];

assert(p1!

p1=head;

head=p0;

num+=1;

TheDATAhavebeeninsertedintothelist."

returnhead;

del(listNode*head,char*DELDATA)//删除链表中数据为DELDATA的节点。

确定要删除该生的资料吗?

if(ch=='

if(head==NULL)

{

cout<

endl<

*没有学生的资料*"

abort();

}

p1=head;

while(p1->

data!

=DELDATA&

&

nextPtr!

=NULL)

p2=p1;

p1=p1->

nextPtr;

if(p1->

data==DELDATA)

if(p1==head)

head=p1->

else

p2->

nextPtr=p1->

\t删除操作成功。

num-=1;

\t没有找到与"

DELDATA<

相匹配的资料。

returnhead;

else

voidlistNode:

printlistNode(listNode*head)//打印以head为头指针的链表。

listNode*p;

if(num==0)

\t没有学生资料。

p=head;

if(head!

do{

p->

data<

p=p->

}while(p!

=NULL);

search(char*sea,listNode*head)

listNode*p=newlistNode[LEN];

listNode*t[MAX2];

intn=0,j=0;

for(inti=0;

i<

num;

i++)

if(head->

data==sea)

n+=1;

while(j<

MAX2)

{

t[j]=head;

j++;

break;

}

head=head->

if(n==0)

sea<

elseif(n==1)

找到一个学生资料,要输出吗?

(y/n)."

charc;

c;

if(c=='

\t该学生学生资料是:

(*t)->

\t找到"

n<

个学生."

要输出这些学生资料(y/n)."

if((c=getchar())!

='

exit

(2);

for(intj=n-1;

j>

=0;

j--)

cout<

j<

(t[j])->

modify(listNode*head)

输入要修改的学生的一项资料(姓名,学号,电话号,身份证号或寝室号):

charch[20];

search(ch,head);

\t即将删除该生的资料,确定吗?

(y/n)"

charc;

cin>

if(c=='

head=del(head,ch);

\t输入修改的学生资料:

head=insert(head);

~listNode()

delete[]nextPtr;

#ifndefInform_h

#defineInform_h

#include<

iomanip.h>

fstream.h>

achieve.h"

******************************Inform.cpp************************************

#include<

ostream&

output

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 学科竞赛

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

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