2022年黄为勇课程设计方案个课程设计方案 .pdf
《2022年黄为勇课程设计方案个课程设计方案 .pdf》由会员分享,可在线阅读,更多相关《2022年黄为勇课程设计方案个课程设计方案 .pdf(24页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、个人资料整理仅限学习使用得分:信电工程学院高级语言程序设计课程设计报告题目:银行存取款管理系统班级: 10 通信班学号: 20180506109 姓名: x x 指导教师:黄为勇精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 1 页,共 24 页个人资料整理仅限学习使用2018 年 1 月 15 日目 录1 程序目标及功能 - 21.1课题背景 -21.2系统功能 -21.3设计要求 -22 程序功能模块组成及流程图-22.1 系统功能模块 -22.2 各模块流程图 -33程序主要数据结构及函数列表 -53.1 程序中使用的数据结构 -53.2 函
2、数列表 -54程序代码及运行结果 -65 总结与体会 -22精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 2 页,共 24 页个人资料整理仅限学习使用1 程序目标及功能1.1 课题背景1)银行存取款系统是针对银行账目的日常管理而设计。银行账目管理系统不仅要求操作方便而且要求界面简洁,它还需要实现账目管理,用户查询功能。2)了解银行存取款业务的流程,使用 C 语言和数据程序知识模拟银行存取款系统。1.2 系统功能该系统功能是输入客户信息,模拟存款与取款,按客户编号查询客户存款取款记录。1.3 设计要求1)在客户文件中,每个客户是一条记录,包括客户编
3、号、客户姓名、支取密码、客户地址、客户电话、账户总金额;2)每个客户对应一个存取款文件。3)在存取款文件中,每次存取款是一条记录,包括编号、日期、类别、存取数目、经办人。类别分为取款和存款两种。4)用函数分别实现动态链表的建立、动态链表输出等功能。5)界面友好,对程序加必要的注释;6)函数功能要划分好 结构化程序设计);函数要求使用指针作形参。取款模块:3查询模块存款功能输入客户的相关输出客户的的存款信息输 入 客 户 的 姓名及编号取款功能输入取款金额是否大于原有金额取款成功结束输入错误大于不大于输出现有金额查询功能结束精选学习资料 - - - - - - - - - 名师归纳总结 - -
4、- - - - -第 5 页,共 24 页个人资料整理仅限学习使用3 程序主要数据结构及函数列表3.1 程序中使用的数据结构struct client long num。char name10 。 /*定义编号,名字,密码,地址,电话号码*/ int password。char addr20。char phone12。int account。struct client *next。 。struct rec long num。 /*结构体定义 */ struct tm *timeinfo。int a 。int account。char person10。struct rec *next。 。3.
5、2 函数列表struct client *creat( /*创建客户信息 */struct client *insert(struct client *head,struct client *cliint sear(struct client *h,struct client *head int total1(struct client *head void print(struct client *head /*输出客户 */ struct rec *creat1(struct client *p void add(struct rec *head,struct rec *record /*
6、追加客户信息*/精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 6 页,共 24 页个人资料整理仅限学习使用struct client *search(struct rec *pr,struct client *pc / *寻找客户信息 */struct rec *dele(struct rec *tou,struct client *head,char nameint total2(struct rec *tou void print1(struct rec *tou,char name,struct client *head4 程序代码及运行结
7、果#include #include #include #include #includerecord.c #define LEN sizeof(struct client #define LENG sizeof(struct rec FILE *fp1,*fp2。time_t rawtime。struct tm *timeinfo。struct rec *tou=0。struct client *head=0。int i=0。void main( void menu( 。 /*创建客户信息 */ void client1(。 void record1(struct client *pc。 v
8、oid save(。 void load(。 char n,name10。 long num 。 i=i+1 。 if(i=1 load(。 menu(。精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 7 页,共 24 页个人资料整理仅限学习使用 while(1 printf(请选择操作种类 .。 n=getch( 。 switch(n case 1: client1(。break。 case 2: client1(。break。 case 3: record1(head。break。 case 4: printf(n请输入姓名: 。scanf(%
9、s,name 。 print1(tou,name,head。 n=getch(。 nu(。break。 case 5: struct client *p。 print(head。 n=getch( 。 menu(。 break 。 case 6: save(。 printf(n请注意收回银行卡 !n 。 exit(0。 default:printf(n。 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 8 页,共 24 页个人资料整理仅限学习使用void client1( char n,name10。 int d。 struct client *p
10、。 printf(n。 printf(n 。 if(head=0 head=creat( 。 if(head!=0 p=(struct client *malloc(LEN。 printf(n。 printf(编号: 。scanf(%ld,&p-num 。 d=sear(p,head。 if(p-num!=0&d=0 printf(姓名: 。scanf(%s,p-name 。 printf(密码: 。scanf(%d,&p-password 。 printf(地址: 。scanf(%s,p-addr。 printf(电话: 。scanf(%s,p-phone 。 p-account=0。 wh
11、ile(p-num!=0&d=0 head=insert(head,p。 p=(struct client *malloc(LEN。 printf(n。 printf(编号: 。scanf(%ld,&p-num 。 d=sear(p,head。 if(p-num!=0&d=0 printf(姓名: 。scanf(%s,p-name 。 printf(密码: 。scanf(%d,&p-password 。 printf(地址: 。scanf(%s,p-addr。 printf(电话: 。scanf(%s, p-phone。精选学习资料 - - - - - - - - - 名师归纳总结 - - -
12、 - - - -第 9 页,共 24 页个人资料整理仅限学习使用 p-account=0。 menu(。 void record1(struct client *pc struct client *d。 struct rec *p。int a=1 。 printf(nn。 printf(*存取款操作 * 。printf(n 。 if(tou=0 tou=creat1(head。 if(tou!=0 p=(struct rec *malloc(LENG。 printf(n。 printf(编号: 。scanf(%ld,&p-num 。 if(p-num!=0 d=search(p,head。 i
13、f(p-num!=0&d!=0 printf(类别。scanf(%d,&p-a 。 printf(存取数目: 。scanf(%d,&p-account。 d-account=d-account+(p-a=1?1:-1*p-account。 if(d-account=0 printf(经办人: 。scanf(%s,p-person。 time (&rawtime。 p-timeinfo=localtime(&rawtime。 a=1 。 elseprintf(余 额 不 足 !n。 a=0 。 d-account=d-account+p-account。system(pause 。while(p
14、-num!=0&d!=0&a!=0 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 10 页,共 24 页个人资料整理仅限学习使用 add(tou,p。 p=(struct rec *malloc(LENG。 printf(n。 printf(编号: 。scanf(%ld,&p-num 。if(p-num!=0 d=search(p,head。 if(p-num!=0&d!=0 printf(类别。scanf(%d,&p-a 。 printf(存取数目: 。scanf(%d,&p-account。 d-account=d-account+(p-a=
15、1?1:-1*p-account。 if(d-account=0 printf(经办人: 。scanf(%s,p-person。 time (&rawtime。 p-timeinfo=localtime(&rawtime。 a=1 。 elseprintf(余 额 不 足 !n。 a=0 。 d-account=d-account+p-account。system(pause 。menu(。 void save( if(fp1=fopen(client,wb=NULL printf(文件操作失败 !n。 system(pause。 exit(0。 while(head!=0 if(fwrite
16、(head,LEN,1,fp1!=1 printf(写入错误 !n。 head=head-next 。 if(fp2=fopen(record,wb=NULL printf(文件操作失败 !n。精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 11 页,共 24 页个人资料整理仅限学习使用 system(pause 。exit(0 。 while(tou!=0 if(fwrite(tou,LEN,1,fp2!=1 printf(写入错误 !n。 tou=tou-next。 fclose(fp1。 fclose(fp2。 void load( stru
17、ct client *p1,*p2。 struct rec *t1,*t2。 int m=0,n=0。 if(fp1=fopen(client,rb=NULL printf(读取客户信息失败 !n。 else p1=(struct client *malloc(LEN。fread(p1,LEN,1,fp1。 while(!feof(fp1 n=n+1 。 if(n=1 head=p1。 else p2-next=p1。 p2=p1 。 p1=(struct client *malloc(LEN。 if(fread(p1,LEN,1,fp1!=1 printf(读入错误 !n。 fclose(f
18、p1。 if(fp2=fopen(record,rb=NULL 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 12 页,共 24 页个人资料整理仅限学习使用printf(读取交易记录失败 !n。 system(pause 。 else t1=(struct rec *malloc(LENG。 fread(t1,LEN,1,fp2。 while(!feof(fp2 m=m+1 。 if(m=1 tou=t1。 else t2-next=t1。 t2=t1。 t1=(struct rec *malloc(LENG。 if(fread(t1,LEN,1
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年黄为勇课程设计方案个课程设计方案 2022 课程设计 方案
限制150内