《面向对象程序设计》课程设计模板1 2.docx
- 文档编号:24294303
- 上传时间:2023-05-26
- 格式:DOCX
- 页数:27
- 大小:76.40KB
《面向对象程序设计》课程设计模板1 2.docx
《《面向对象程序设计》课程设计模板1 2.docx》由会员分享,可在线阅读,更多相关《《面向对象程序设计》课程设计模板1 2.docx(27页珍藏版)》请在冰豆网上搜索。
《面向对象程序设计》课程设计模板12
成绩
南京工程学院
课程设计说明书(论文)
题目图书管理系统
课程名称面向对象程序设计
院(系、部、中心)康尼学院
专业信息工程
班级K信息工程091
学生姓名邢超
学号240092621
设计地点C205
指导教师郭丽红
设计起止时间:
2010年12月13日至2010年12月17日
目录
1.系统设计的目的和意义8
2.系统总框架图8
3.软件功能描述8
4.软件代码的设计8
4.1数据结构描述与定义9
4.2模块设计9
5.软件使用说明9
6.测试结果与分析9
7.比较有特色的函数9
8.存在的不足与对策9
9.课程设计总结9
附录:
源程序清单9
课程设计题目
1.系统设计的目的和意义
目的:
图书管理系统主要目的是对图书馆种类繁多的书籍进行管理,并且合理管理好用户的借还信息提高图书馆的工作效率,降低管理成本。
意义:
通过完成从用户需求分析、数据库设计到上机编程、调试和应用等全过程,进一步了解和掌握本书中所讲解的内容。
2.
系统总框架图
3软件功能描述
用户名和密码输入正确以后,进入个人借阅信息栏,这样来确定个人借阅情况!
4.软件代码的设计
#include"stdafx.h"
#include"damned.h"
#include"damn.h"
#include"demon.h"
#ifdef_DEBUG
#definenewDEBUG_NEW
#undefTHIS_FILE
staticcharTHIS_FILE[]=__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//damndialog
damn:
:
damn(CWnd*pParent/*=NULL*/)
:
CDialog(damn:
:
IDD,pParent)
{
//{{AFX_DATA_INIT(damn)
m_S=_T("");
m_C=_T("");
m_Z=_T("");
m_R=_T("");
m_J=_T("");
m_M=_T("");
m_B=_T("");
m_Y=_T("");
//}}AFX_DATA_INIT
}
voiddamn:
:
DoDataExchange(CDataExchange*pDX)
{
CDialog:
:
DoDataExchange(pDX);
//{{AFX_DATA_MAP(damn)
DDX_Text(pDX,IDC_EDIT1,m_S);
DDX_Text(pDX,IDC_EDIT2,m_C);
DDX_Text(pDX,IDC_EDIT3,m_Z);
DDX_Text(pDX,IDC_EDIT4,m_R);
DDX_Text(pDX,IDC_EDIT5,m_J);
DDX_Text(pDX,IDC_EDIT6,m_M);
DDX_Text(pDX,IDC_EDIT7,m_B);
DDX_Text(pDX,IDC_EDIT8,m_Y);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(damn,CDialog)
//{{AFX_MSG_MAP(damn)
ON_BN_CLICKED(IDC_BUTTON1,OnButton1)
ON_BN_CLICKED(IDC_BUTTON2,OnButton2)
ON_BN_CLICKED(IDC_BUTTON3,OnButton3)
ON_BN_CLICKED(IDC_BUTTON4,OnButton4)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//damnmessagehandlers
voiddamn:
:
OnButton1()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{AfxMessageBox("error");
}
UpdateData(true);
temp.MoveLast();
temp.AddNew();
temp.m_Shuming=m_S;
temp.m_Chubanshijian=m_C;
temp.m_Zuozhe=m_Z;
temp.m_Rukushijian=m_R;
temp.m_Jiage=m_J;
temp.m_Mairubenshu=m_M;
temp.m_Beijiechubenshu=m_B;
temp.m_Yijiechushijian=m_Y;
temp.Update();
temp.Close();
MessageBox("添加成功!
");
}
voiddamn:
:
OnButton2()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{AfxMessageBox("error");
}
UpdateData(true);
temp.MoveFirst();
do{if(temp.m_Shuming!
=m_S)
temp.MoveNext();
else{flag=1;break;
}
}while(!
temp.IsEOF());
temp.Delete();
temp.Close();
MessageBox("删除成功!
");
//TODO:
Addyourcontrolnotificationhandlercodehere
}
voiddamn:
:
OnButton3()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{
AfxMessageBox("error");
}
UpdateData(true);
temp.MoveFirst();
do{
if(temp.m_Shuming!
=m_S)
temp.MoveNext();
else
{
flag=1;break;
}
}while(!
temp.IsEOF());
if(flag==1)
{
m_S=temp.m_Shuming;
m_C=temp.m_Chubanshijian;
m_Z=temp.m_Zuozhe;
m_R=temp.m_Rukushijian;
m_J=temp.m_Jiage;
m_M=temp.m_Mairubenshu;
m_B=temp.m_Beijiechubenshu;
m_Y=temp.m_Yijiechushijian;
temp.Close();
UpdateData(false);
}
else
{
temp.Close();
AfxMessageBox("查无此书!
");//TODO:
Addyourcontrolnotificationhandlercodehere
}
}
voiddamn:
:
OnButton4()
{
//TODO:
Addyourcontrolnotificationhandlercodehere
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{
AfxMessageBox("error");
}
UpdateData(true);
temp.MoveFirst();
do
{
if(temp.m_Shuming!
=m_S)
temp.MoveNext();
else
{
flag=1;break;
}
}while(!
temp.IsEOF());
if(flag==1)
{temp.Edit();
temp.m_Shuming=m_S;
temp.m_Chubanshijian=m_C;
temp.m_Zuozhe=m_Z;
temp.m_Rukushijian=m_R;
temp.m_Jiage=m_J;
temp.m_Mairubenshu=m_M;
temp.m_Beijiechubenshu=m_B;
temp.m_Yijiechushijian=m_Y;
temp.Update();
temp.Close();
MessageBox("修改成功!
");
}
else
{
temp.Close();
AfxMessageBox("查无此书!
");
}
}
voiddamn:
:
OnOK()
{
//TODO:
Addyourcontrolnotificationhandlercodehere
}
voiddamn:
:
OnCancel()
{
//TODO:
Addextracleanuphere
CDialog:
:
OnCancel();
}
4.1数据结构描述与定义
添加功能函数:
voiddamn:
:
OnButton1()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{AfxMessageBox("error");
}
UpdateData(true);
temp.MoveLast();
temp.AddNew();
temp.m_Shuming=m_S;
temp.m_Chubanshijian=m_C;
temp.m_Zuozhe=m_Z;
temp.m_Rukushijian=m_R;
temp.m_Jiage=m_J;
temp.m_Mairubenshu=m_M;
temp.m_Beijiechubenshu=m_B;
temp.m_Yijiechushijian=m_Y;
temp.Update();
temp.Close();
MessageBox("添加成功!
");
}
删除功能函数:
voiddamn:
:
OnButton2()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{AfxMessageBox("error");
}
UpdateData(true);
temp.MoveFirst();
do{if(temp.m_Shuming!
=m_S)
temp.MoveNext();
else{flag=1;break;
}
}while(!
temp.IsEOF());
temp.Delete();
temp.Close();
MessageBox("删除成功!
");
//TODO:
Addyourcontrolnotificationhandlercodehere
}
查询功能函数:
voiddamn:
:
OnButton3()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{
AfxMessageBox("error");
}
UpdateData(true);
temp.MoveFirst();
do{
if(temp.m_Shuming!
=m_S)
temp.MoveNext();
else
{
flag=1;break;
}
}while(!
temp.IsEOF());
if(flag==1)
{
m_S=temp.m_Shuming;
m_C=temp.m_Chubanshijian;
m_Z=temp.m_Zuozhe;
m_R=temp.m_Rukushijian;
m_J=temp.m_Jiage;
m_M=temp.m_Mairubenshu;
m_B=temp.m_Beijiechubenshu;
m_Y=temp.m_Yijiechushijian;
temp.Close();
UpdateData(false);
}
else
{
temp.Close();
AfxMessageBox("查无此书!
");//TODO:
Addyourcontrolnotificationhandlercodehere
}
}
修改功能函数:
voiddamn:
:
OnButton4()
{
//TODO:
Addyourcontrolnotificationhandlercodehere
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{
AfxMessageBox("error");
}
UpdateData(true);
temp.MoveFirst();
do
{
if(temp.m_Shuming!
=m_S)
temp.MoveNext();
else
{
flag=1;break;
}
}while(!
temp.IsEOF());
if(flag==1)
{temp.Edit();
temp.m_Shuming=m_S;
temp.m_Chubanshijian=m_C;
temp.m_Zuozhe=m_Z;
temp.m_Rukushijian=m_R;
temp.m_Jiage=m_J;
temp.m_Mairubenshu=m_M;
temp.m_Beijiechubenshu=m_B;
temp.m_Yijiechushijian=m_Y;
temp.Update();
temp.Close();
MessageBox("修改成功!
");
}
else
{
temp.Close();
AfxMessageBox("查无此书!
");
4.2模块设计
系统共分2个模块,选择登陆模块和学生信息模块。
5.软件使用说明
此软件登陆界面输入正确的用户名和密码,就可以进入学生信息界面,可以进行添加、删除、修改和查询等操作。
6.测试结果与分析
由于我的电脑和VC6.0不兼容,没法在此环境下运行,Access也没有安装。
所以运行截图只能省略了,就是检查时给老师您看的那样,还望见谅!
7.比较有特色的函数
修改密码功能,但不完整。
8.存在的不足与对策
修改功能函数不能达到我想要的效果
voiddamn:
:
OnButton4()
{
//TODO:
Addyourcontrolnotificationhandlercodehere
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{
AfxMessageBox("error");
}
UpdateData(true);
temp.MoveFirst();
do
{
if(temp.m_Shuming!
=m_S)
temp.MoveNext();
else
{
flag=1;break;
}
}while(!
temp.IsEOF());
if(flag==1)
{temp.Edit();
temp.m_Shuming=m_S;
temp.m_Chubanshijian=m_C;
temp.m_Zuozhe=m_Z;
temp.m_Rukushijian=m_R;
temp.m_Jiage=m_J;
temp.m_Mairubenshu=m_M;
temp.m_Beijiechubenshu=m_B;
temp.m_Yijiechushijian=m_Y;
temp.Update();
temp.Close();
MessageBox("修改成功!
");
}
else
{
temp.Close();
AfxMessageBox("查无此书!
");
}
}
9.课程设计总结
这一周的课程设计,走下来着实让人感到很累。
因为每一步都要反复操作,失败了,再来,又失败,又再来,比如映射那块,足足让我搞了一上午。
当时很想放弃,但最终还是咬着牙坚持了下来,这里也多亏旁边的同学和郭老师您的指导。
虽然很辛苦,但是成功之后的喜悦也是难以言表的。
C++是一门很重要的学科,我们以后就业还可能用到它,所以以后我一定要再去深入学习它。
同时这次的课程设计让我们将理论与实践有机结合,让我对C++有了更好的理解。
附录:
源程序清单
#include"stdafx.h"
#include"damned.h"
#include"damn.h"
#include"demon.h"
#ifdef_DEBUG
#definenewDEBUG_NEW
#undefTHIS_FILE
staticcharTHIS_FILE[]=__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//damndialog
damn:
:
damn(CWnd*pParent/*=NULL*/)
:
CDialog(damn:
:
IDD,pParent)
{
//{{AFX_DATA_INIT(damn)
m_S=_T("");
m_C=_T("");
m_Z=_T("");
m_R=_T("");
m_J=_T("");
m_M=_T("");
m_B=_T("");
m_Y=_T("");
//}}AFX_DATA_INIT
}
voiddamn:
:
DoDataExchange(CDataExchange*pDX)
{
CDialog:
:
DoDataExchange(pDX);
//{{AFX_DATA_MAP(damn)
DDX_Text(pDX,IDC_EDIT1,m_S);
DDX_Text(pDX,IDC_EDIT2,m_C);
DDX_Text(pDX,IDC_EDIT3,m_Z);
DDX_Text(pDX,IDC_EDIT4,m_R);
DDX_Text(pDX,IDC_EDIT5,m_J);
DDX_Text(pDX,IDC_EDIT6,m_M);
DDX_Text(pDX,IDC_EDIT7,m_B);
DDX_Text(pDX,IDC_EDIT8,m_Y);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(damn,CDialog)
//{{AFX_MSG_MAP(damn)
ON_BN_CLICKED(IDC_BUTTON1,OnButton1)
ON_BN_CLICKED(IDC_BUTTON2,OnButton2)
ON_BN_CLICKED(IDC_BUTTON3,OnButton3)
ON_BN_CLICKED(IDC_BUTTON4,OnButton4)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//damnmessagehandlers
voiddamn:
:
OnButton1()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
temp.Open(demon:
:
dynaset,_T(str)))
{AfxMessageBox("error");
}
UpdateData(true);
temp.MoveLast();
temp.AddNew();
temp.m_Shuming=m_S;
temp.m_Chubanshijian=m_C;
temp.m_Zuozhe=m_Z;
temp.m_Rukushijian=m_R;
temp.m_Jiage=m_J;
temp.m_Mairubenshu=m_M;
temp.m_Beijiechubenshu=m_B;
temp.m_Yijiechushijian=m_Y;
temp.Update();
temp.Close();
MessageBox("添加成功!
");
}
voiddamn:
:
OnButton2()
{
demontemp;
CStringstr="select*from表1";
intflag=0;
if(!
te
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 面向对象程序设计 面向对象程序设计课程设计模板1 面向 对象 程序设计 课程设计 模板