《学生成绩管理系统》c++源程序Word文档格式.doc

上传人:b****2 文档编号:14618264 上传时间:2022-10-23 格式:DOC 页数:14 大小:64.50KB
下载 相关 举报
《学生成绩管理系统》c++源程序Word文档格式.doc_第1页
第1页 / 共14页
《学生成绩管理系统》c++源程序Word文档格式.doc_第2页
第2页 / 共14页
《学生成绩管理系统》c++源程序Word文档格式.doc_第3页
第3页 / 共14页
《学生成绩管理系统》c++源程序Word文档格式.doc_第4页
第4页 / 共14页
《学生成绩管理系统》c++源程序Word文档格式.doc_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

《学生成绩管理系统》c++源程序Word文档格式.doc

《《学生成绩管理系统》c++源程序Word文档格式.doc》由会员分享,可在线阅读,更多相关《《学生成绩管理系统》c++源程序Word文档格式.doc(14页珍藏版)》请在冰豆网上搜索。

《学生成绩管理系统》c++源程序Word文档格式.doc

charTel[30];

};

classCStudent:

publicCPerson//----CStudent类--继承自CPerson成员:

StudNoMath English Average

charStudNo[30];

doubleMath;

doubleEnglish;

doubleAverage;

classCClass//-----------CClass类成员:

CClassNameCStudent

{

private:

charCClassName[30];

CStudent*stu[50];

CClass();

~CClass();

voidCreateClass();

//

voidOutClassName();

//输出班级名字

voidNewAStu();

//1.创建学生信息

voidchange();

//3.修改学生信息

voiddel();

//4.删除学生信息

voidwritein();

//文件写入

voidwriteout();

//文件读出

voidwriteino();

//文件另存为

voidwriteouto();

//打开其他文件

voidfind();

//6.查询学生信息

voidback()//---------------------------------------//刷频函数

cout<

<

"

\t\t\t执行成功!

endl;

system("

pause"

);

//任意键继续

cls"

//清除屏幕

}

voidback_no()

voidtitle()//--------------

---------------学生信息管理程序---------------\n您现在的位置:

\t主菜单-->

;

voidCClass:

:

writein()//--------------保存文件

ofstreamSaveFile("

myfile.txt"

SaveFile<

CClassName<

\t"

time<

for(inti=0;

i<

time;

i++)

{

SaveFile<

stu[i]->

IDNo<

<

Name<

Addr<

Tel<

StudNo<

Math<

English<

Average<

}

SaveFile.close();

ofstreamSave(name_);

Save<

for(intj=0;

j<

j++)

Save<

stu[j]->

Save.close();

writeino()//--------------------文件另存为

charchoice[30];

ofstreamfop;

ifstreamfip;

文件已默认保存了!

\t现在需要另存为?

(Y/N)"

cin>

>

choice;

while(strcmp(choice,"

Y"

)==0||strcmp(choice,"

y"

)==0)

cout<

请输入文件名称:

cin>

name_;

strcat(name_,"

.txt"

fop.open(name_);

fop<

for(inti=0;

{

fop<

}

fip.close();

另存为"

name_<

成功!

back_no();

return;

n"

N"

)!

=0||strcmp(choice,"

=0)

输入错误!

writeout()//--------------

inti=0;

charc[30];

FILE*fp;

if((fp=fopen("

"

r"

))==NULL)

{

cann'

topenthefile\n"

exit(0);

fscanf(fp,"

%s%d"

c,&

time);

strcpy(CClassName,c);

while(i<

time)

{

fscanf(fp,"

%s%s%s%s%s%lf%lf%lf"

stu[i]->

IDNo,stu[i]->

Name,stu[i]->

Addr,&

Tel,stu[i]->

StudNo,&

Math,&

English,&

Average);

i++;

}

fclose(fp);

/*关闭文件*/

恭喜你!

成功读取班级信息!

\n"

writeouto() //-----------------------打开其他文件

fstream_file;

strcat(name_,"

//创建文件名

ifstreamfin(name_);

_file.open(name_,ios:

in);

while(!

_file)

没有被创建\n"

if((fp=fopen(name_,"

CClass:

CClass()//--------------

50;

stu[i]=newCStudent();

~CClass()//--------------

delete stu[i];

CreateClass()//--------------创建班级

{

charchoice[30];

char*c;

charcname[30];

---------------学生信息管理程序---------------"

1、创建班级"

endl

<

2、读取班级信息"

3、退出程序"

请选择:

for(into=0;

o<

100;

o++)

while(strcmp(choice,"

1"

system("

cout<

请输入班级名称:

c=newchar[];

cin>

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

当前位置:首页 > 人文社科 > 视频讲堂

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

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