c语言课程设计自动取款机,C语言课程设计………银行自动存取款机模拟.doc

C语言课程设计………银行自动存取款机模拟

作者:周鸣

需求分析:

本程序设计的任务为银行自助存取款机,程序要求实现atm机的基本功能,如 开户.查询.存款.取款.转账.容而生成操作日志。

概要设计:

数据类型:int,char,FILE.

主程序流程:int main ()

1:进入dl()函数。

2:核对输入账户与密码。

核对成功则进入dljm()函数。

选择操作功能。

完成操作,回到功能选择一栏。

可选择退卡以结束所有操作。

标准函数名称和自定义名称:

Void dl ()

Void dljm ()

Void cx()

Void ck()

Void qk()

Void zz()

主程序的流程及各函数之间的流程关系。(用图来描述)

#include

#include

int x,k;

void dl();

int dljm();

void cx();

void qk();

void zz();

void ck();

void tk();

FILE *fp;

FILE *fg;

struct atm

{

char name[10];

int account;

short password;

float money;}at[10]={{"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,"%d\n",account);

if(account>10)

dl();

for(k=0;k<=9;k++)

{

if(account==at[k].account)

{ x=k;fprintf(fp,"please enter the card number:%d\n");

printf("please enter password:");

fprintf(fg,"please enter password:\n");

scanf("%d",&password);

fprintf(fg,"%d\n",password);

for(i=1;i<4;i++)

{if(password==at[k].password)

{ fprintf(fg,"please enter the password:%d\n");

printf("log in successfully,please select operation\n");

fprintf(fg,"log in successfully,please select operation\n");

dljm();

break;

}

else

{

printf

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值