C语言课程设计…………银行自动存取款机模拟.doc_第1页
C语言课程设计…………银行自动存取款机模拟.doc_第2页
C语言课程设计…………银行自动存取款机模拟.doc_第3页
C语言课程设计…………银行自动存取款机模拟.doc_第4页
C语言课程设计…………银行自动存取款机模拟.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

作者:周鸣需求分析:本程序设计的任务为银行自助存取款机,程序要求实现atm机的基本功能,如 开户.查询.存款.取款.转账.容而生成操作日志。2. 概要设计:数据类型:int,char,FILE.主程序流程:int main ()1:进入dl()函数。2:核对输入账户与密码。3. 核对成功则进入dljm()函数。4. 选择操作功能。5. 完成操作,回到功能选择一栏。6. 可选择退卡以结束所有操作。标准函数名称和自定义名称:Void dl ()Void dljm ()Void cx()Void ck()Void qk()Void zz()开始程序 开始程序3. 主程序的流程及各函数之间的流程关系。(用图来描述) 进入dl函数 输入账号 输入密码进入dljm函数选择atm机功能输入“100”,退出函数进入zz函数进入tk函数进入ck函数进入qk函数进入cx函数15432#include#includeint x,k;void dl();int dljm();void cx();void qk();void zz();void ck();void tk();FILE *fp;FILE *fg;struct atm char name10; int account; short password; float money;at10=AA,1,1,4000,BB,2,2,4000,CC,3,3,4000, DD,4,4,4000,EE,5,5,4000,GG,6,6,4000, HH,7,7,4000,II,8,8,4000,JJ,9,9,4000, kk,10,10,4000;void main() char filename=zhouming.txt; char mode=w,b=AA 1 1 4000 BB 2 2 4000 CC 3 3 4000 DD 4 4 4000 EE 5 5 4000 GG 6 6 4000 HH 7 7 4000 II 8 8 4000 JJ 9 9 4000 KK 10 10 4000; clrscr(); if(fg=fopen(x.txt,a+)=NULL) printf(cannot open the file zhouming!strike any exit); getch(); exit(1); dl();if(fp=fopen(filename,mode)!=NULL)fputs(b,fp);fclose(fp); void dl()int account,i,j;short password;printf(please enter the card number:);fprintf(fg,please enter the card number:n);scanf(%d,&account);fprintf(fg,%dn,account);if(account10)dl();for(k=0;k=9;k+)if(account=atk.account) x=k;fprintf(fp,please enter the card number:%dn);printf(please enter password:);fprintf(fg,please enter password:n);scanf(%d,&password);fprintf(fg,%dn,password);for(i=1;iatk.money)printf(lack of balance);fprintf(fg,lack of banlance);elseprintf(you have taken out %7.2f yuan ,a);fprintf(fg,you have taken out %7.2f yuan,a);atk.money=atk.money-a; void zz() float a;int t,account,i=1; printf(please enter transfer amount:); fprintf(fg,please enter transfer amount:); scanf(%f,&a); fprintf(fg,%nf,a); if(aatk.money) printf(lack of money,please input again!); fprintf(fg,lack of money,please input again!); scanf(%f,&a); fprintf(fg,%fn,a); printf(please enter the transfered bank account:); fprintf(fg,please enter the transfered bank account:); scanf(%d,&account); fprintf(fg,%dn,account);while(i!=3) for(t=0;t9) break; i=i+1; printf(error! input again!n); fprintf(fg,error!input again!n); scanf(%d,&account); fprintf(fg,%dn,account); if(i=3) system(cls); main(); void ck()int a;int i;printf(please put the money into the slotn);fprintf(fg,please put the money into the slotn);for(i=0;i1000000000000000;i+);scanf(%d,&a);fprintf(fg,%dn,a);printf(please make sure the number of bill !n);fprintf(fg,please make sure the number of bill!n);atk.money=atk.money+a;fprintf(fg,operation is successful);printf(operation is successful); void tk() int i,j;printf(please get back your card n);fprintf(fg,please get back your cardn);for(i=0;i1000000000000000;i+);system(cls);main();printf(enter ,if you want go out );scanf(%d,&j);if(j=100)exit(1); 4. 调试分析:(1) 调试发现许多语法或逻辑错误,然都已搞定。5. 用户使用说明:(1) 进入程序,界面会提示输入账号。(

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论