课程设计报告媒体库管理系统周晗文档格式.docx

上传人:b****1 文档编号:1400026 上传时间:2023-04-30 格式:DOCX 页数:37 大小:104.96KB
下载 相关 举报
课程设计报告媒体库管理系统周晗文档格式.docx_第1页
第1页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第2页
第2页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第3页
第3页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第4页
第4页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第5页
第5页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第6页
第6页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第7页
第7页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第8页
第8页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第9页
第9页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第10页
第10页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第11页
第11页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第12页
第12页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第13页
第13页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第14页
第14页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第15页
第15页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第16页
第16页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第17页
第17页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第18页
第18页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第19页
第19页 / 共37页
课程设计报告媒体库管理系统周晗文档格式.docx_第20页
第20页 / 共37页
亲,该文档总共37页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

课程设计报告媒体库管理系统周晗文档格式.docx

《课程设计报告媒体库管理系统周晗文档格式.docx》由会员分享,可在线阅读,更多相关《课程设计报告媒体库管理系统周晗文档格式.docx(37页珍藏版)》请在冰点文库上搜索。

课程设计报告媒体库管理系统周晗文档格式.docx

3)显示物品库

可显示当前物品库中所有的物品信息。

4)修改物品

可根据查询结果对相应的记录进行修改,修改时注意编号的唯一性。

5)删除物品

对已添加的物品信息进行删除。

如果当前物品库为空,则提示“物品库为空!

”并返回操作;

否则输入要删除的编号,根据编号删除该物品信息,如果没有找到该物品信息,则提示“该编号不存在”。

6)统计功能

输出当前物品库中总物品数,以及按物品类别,统计出当前物品中各类别的物品数并显示。

7)保存物品

将当前系统中物品信息存入文件中。

8)读取物品

将保存在文件中的物品信息读入到当前系统中,以供用户使用。

在完成以上基本功能的基础上,可自行进行扩展或完善。

1.系统需求分析

1.1系统设计的目的与意义:

图书馆中的资料很多,如果能分类对其资料流通进行管理,将会带来很多方便,因此需要有一个媒体库管理系统。

1.2系统功能需求:

图书馆共有三大类物品资料:

图书、视频光盘、图画。

2)查询物品

3)显示物品库

4)修改物品

7)保存物品

8)读取物品

2.总体设计

2.1系统功能分析:

系统通过调用函数来实现信息录入、信息修改、信息删除、信息查询以及数据保存文件等功能。

add()函数用于录入信息;

modify()函数用来修改信息;

del()函数用来修改信息;

searchStu()及searchScore()函数用来查询某班级中所有学生信息及查询某学生所有课程的成绩信息;

read()函数用于将文件中的数据读取到内存中;

save()函数用于将内存中的信息存入文件内;

主函数main()用于调用这些函数。

2.2系统功能模块划分与设计:

系统定义了Class类、Student类、Course类、Score类这四个类,定义了add()、modify()、del()、read()及save()等函数来实现系统所需功能。

2.3系统功能模块图:

2.4类的设计

(1)Base类(抽象类)的设计:

图3.1Base类

(2)图书类的设计:

图3.2图书类

(3)视频类的设计:

图3.3视频类

(4)图画类的设计:

图3.4图画类

3.详细设计及实现

3.1Base类(抽象类)的实现

classBase

{

public:

charnumber[20];

//编号

chartitle[11];

//标题

charwriter[8];

//作者

chargrade[20];

//评级

virtualvoidread()=0;

virtualvoidadd()=0;

virtualvoidmodify(int)=0;

virtualvoiddel(int)=0;

virtualvoidsave()=0;

};

3.2图书类的实现

Book.h

classBook:

publicBase

intISBNno;

//ISBN号

charpress[9];

//出版社

intpage;

//页数

voidread();

voidadd();

voidmodify(int);

voiddel(int);

voidsave();

Book.cpp

voidBook:

:

read()

{

fstreambookfile("

图书类信息.dat"

ios:

in|ios:

out);

bookfile>

>

b1[count_Book].number>

b1[count_Book].title>

b1[count_Book].writer>

b1[count_Book].grade>

b1[count_Book].ISBNno>

b1[count_Book].press>

b1[count_Book].page;

while(!

bookfile.eof())

count_Book++;

}

bookfile.close();

}

add()

{//存入对象数组中

strcpy(b1[count_Book].number,number);

strcpy(b1[count_Book].title,title);

strcpy(b1[count_Book].writer,writer);

strcpy(b1[count_Book].grade,grade);

b1[count_Book].ISBNno=ISBNno;

strcpy(b1[count_Book].press,press);

b1[count_Book].page=page;

count_Book++;

modify(intindex)

strcpy(b1[index-1].number,number);

strcpy(b1[index-1].title,title);

strcpy(b1[index-1].writer,writer);

strcpy(b1[index-1].grade,grade);

b1[index-1].ISBNno=ISBNno;

strcpy(b1[index-1].press,press);

b1[index-1].page=page;

del(intindex){

//前移其后记录

for(inti=index;

i<

=count_Book-1;

i++)

{

strcpy(b1[i-1].number,b1[i].number);

strcpy(b1[i-1].title,b1[i].title);

strcpy(b1[i-1].writer,b1[i].writer);

strcpy(b1[i-1].grade,b1[i].grade);

b1[i-1].ISBNno=b1[i].ISBNno;

strcpy(b1[i-1].press,b1[i].press);

b1[i-1].page=b1[i].page;

count_Book--;

save()

ofstreambookfile;

bookfile.open("

);

for(inti=0;

i++)

bookfile<

<

b1[i].number<

"

"

b1[i].title<

b1[i].writer<

b1[i].grade<

b1[i].ISBNno<

b1[i].press<

b1[i].page<

endl;

bookfile.close();

3.3视频类的实现

Video.h

classVideo:

charname;

//出品人姓名

chartime;

//出品年份

intduration;

//视频时长

Video.cpp

voidVideo:

fstreamvideofile("

班级信息.dat"

videofile>

v1[count_Video].number>

v1[count_Video].title>

v1[count_Video].writer>

v1[count_Video].grade>

v1[count_Video].name>

v1[count_Video].time>

v1[count_Video].duration;

videofile.eof())

count_Video++;

videofile>

videofile.close();

{//存入对象数组中

strcpy(v1[count_Video].number,number);

strcpy(v1[count_Video].title,title);

strcpy(v1[count_Video].writer,writer);

strcpy(v1[count_Video].grade,grade);

strcpy(v1[count_Video].name,name);

strcpy(v1[count_Video].time,time);

v1[count_Video].duration=duration;

count_Video++;

{

strcpy(v1[index-1].number,number);

strcpy(v1[index-1].title,title);

strcpy(v1[index-1].writer,writer);

strcpy(v1[index-1].grade,grade);

strcpy(v1[index-1].name,name);

strcpy(v1[index-1].time,time);

v1[index-1].duration=duration;

del(intindex)

=count_Video-1;

strcpy(v1[i-1].number,v1[i].number);

strcpy(v1[i-1].title,v1[i].title);

strcpy(v1[i-1].writer,v1[i].writer);

strcpy(v1[i-1].grade,v1[i].grade);

strcpy(v1[i-1].name,v1[i].name);

strcpy(v1[i-1].time,v1[i].time);

v1[i-1].duration=v1[i].duration;

count_Video--;

ofstreamvideofile;

videofile.open("

videofile<

c1[i].classID<

c1[i].stuNum<

3.4图画类的实现

Painting.h

classPainting:

charnationality[20];

//出品国籍

charsize[20];

//作品大小

Painting.cpp

voidPainting:

fstreampaitingfile("

图画类信息.dat"

paintingfile>

p1[count_Painting].number>

p1[count_Painting].title>

p1[count_Painting].writer>

p1[count_Painting].grade>

p1[count_Painting].nationality>

p1[count_Painting].size;

while(!

paintingfile.eof())

count_Painting++;

paintingfile>

paintingfile.close();

//存入对象数组中

strcpy(p1[count_Painting].number,number);

strcpy(p1[count_Painting].title,title);

strcpy(p1[count_Painting].writer,writer);

strcpy(p1[count_Painting].grade,grade);

strcpy(p1[count_Painting].nationality,nationality);

strcpy(p1[count_Painting].size,size);

count_Painting++;

strcpy(p1[index-1].number,number);

strcpy(p1[index-1].title,title);

strcpy(p1[index-1].writer,writer);

strcpy(p1[index-1].grade,grade);

strcpy(p1[index-1].nationality,nationality);

strcpy(p1[index-1].size,size);

=count_Class-1;

strcpy(p1[i-1].number,p1[i].number);

strcpy(p1[i-1].title,p1[i].title);

strcpy(p1[i-1].writer,p1[i].writer);

strcpy(p1[i-1].grade,p1[i].grade);

strcpy(p1[i-1].nationality,p1[i].nationality);

strcpy(p1[i-1].size,p1[i].size);

count_Painting--;

ofstreamPaintingfile;

Paintingfile.open("

=count_Painting-1;

Paintingfile<

p1[i].number<

p1[i].title<

p1[i].writer<

p1[i].grade<

p1[i].nationality<

p1[i].size<

Paintingfile.close();

3.5main.cpp

#include<

iostream.h>

fstream.h>

string.h>

stdlib.h>

#include"

Base.h"

Book.h"

Painting.h"

Video.h"

constintMAXBOOK=10;

constintMAXPAINTING=200;

constintMAXVIDEO=10;

Bookb1[MAXBOOK];

Paintingp1[MAXPAINTING];

Videoc2[MAXVIDEO];

intcount_Book=0;

intcount_Painting=0;

intcount_Video=0;

Base*p=NULL;

charout;

//图书类管理子菜单

voidbook_manage()

intchoice,i=0;

boolquit=false;

while

(1)

system("

cls"

cout<

**********图书类管理子菜单**********"

1.添加图书信息"

2.修改图书信息"

3.删除图书信息"

0.退出"

************************************"

请输入所要操作的编号:

;

cin>

choice;

switch(choice)

case1:

{

Bookb2;

p=&

b2;

请输入编号、标题、作者、评级、ISBN号、出版社和页

数:

\n"

cin>

b2.number>

b2.title>

b2.writer>

b2.grade>

b2.ISBNno>

b2.press>

b2.page>

cout<

是否保存图书信息?

(y/n)\n"

out;

if(out=='

y'

{

p->

add();

p->

save();

}

break;

}

case2:

{

Bookb3;

b3;

intindex;

for(inti=0;

count_Book;

i+1<

."

请选择图书信息编号:

cin>

index;

cout<

请输入要修改的标题、作者、评级、ISBN号、出版社和页

b3.title>

b3.writer>

b3.grade>

b3.ISBNno>

b3.press>

b3.page;

是否保存班级信息?

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

当前位置:首页 > 人文社科 > 法律资料

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

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