银行卡管理系统C语言设计
银行卡管理系统C语言设计
桑青青
来自:
网页
2021-04-05 12:42
声明:本网站依照法律规定提供财经资讯,未授权或允许任何组织与个人发布交易广告。对任何广告信息请谨慎交易,谨防诈骗。举报邮箱:xxxxxxxxx@qq.com
2021-04-05 12:45最佳答案
内容来自用户:ujdjfdu
程序设计基础(C语言)课程设计说明书
(20~20学年第_1_学期)
题目名称:银行存取款管理系统
姓名
学号
专业
班级
指导教师
提交日期
湖南应用技术学院课程设计任务书
课程名称|程序设计(C语言)课程设计|课程代码| |
设计题目|银行存取款管理系统|分组人数|设计时间|学院|专业|班级|一、课程设计任务(条件)、具体技术参数(指标)|1.我在指导书提供的课程设计题目中选择了21题,已经得老师认可|2.我通过编写程序提供的主操作界面应该方便用户的操作。|3.最后提交的课程设计成果包括:|(1).课程设计报告电子稿。|(2).源程序文件。|(3).可执行程序文件。|
二、对课程设计成果的要求(包括课程设计说明书、图纸、图表、实物等软硬件要求)|1.分析课程设计题目的要求;|2.写出详细设计说明;|3.编写程序代码,调试程序使其能正确运行;|4.设计完成的软件要便于操作和使用,有整齐、美观的使用界面;|5.设计完成后提交课程设计报告和源代码文件的电子文档。|
三、课程设计工作进度计划:|2018/1/2 分析选题及解决方案的思考。|2018/1/3 确定解题的过程及系统所需的功能函数,进行代码编写。|2018/1/4 代码编写并开始写课程设计说明书。|2018/1/5 代码编写并调试运行,写课程设计说明书。|2018/1/6 完善程序和课程设计说明书、答辩,上交所有课程设。计资料|
四、主要参考资料|[1]柴田望洋主编.
其他回答(共7条)
-
2021-04-05 13:03 黄真强 客户经理
参考如下:
#include <conio.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
char cFile[] = "date.txt";
struct bank
{
char id[10+1];
char psw[6+1];
double money;
};
welcome1()
{
printf("\n\n\t\t欢迎使用虚拟银行自动取款机服务!\t\t\n\n");
printf("请选择功能:\n");
printf("\n=================================================\n");
printf(" || 请输入序号 ||\n");
printf(" || 1.新用户开户。 ||\n");
printf(" || 2.老用户登陆。 ||\n");
printf(" || 3.退出系统。 ||\n");
printf("=================================================\n");
}
welcome2()
{
printf("\n\n\t\t注册须知\n\n");
printf("**************************************************\n");
printf("* 1.请填写您的真实资料! *\n");
printf("* 2.开户首期必须存入100元以上 *\n");
printf("**************************************************\n");
}
welcome3()
{
printf("\n\n\t\t\3 欢迎进入虚拟银行系统 \3\n\n");
printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\n");
printf("\1\1\t 请选择功能:1.取款(最多透资2000); \1\1\n");
printf("\1\1\t 2.存款; \1\1\n");
printf("\1\1\t 3.查询余额; \1\1\n");
printf("\1\1\t 4.修改密码; \1\1\n");
printf("\1\1\t 5.返回主页面; \1\1\n");
printf("\1\1\t 任意键退出. \1\1\n");
printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\n");
}
int search(char* user, char* pwd, char* real_pwd)/*判断帐号是否相同,不相同返回1*/
{
FILE* file;
char user_buff[256], pwd_buff[256];
file = fopen(cFile, "r");
if (!file) return 0;
while (!feof(file))
{
if (fscanf(file, "%s%s\n", user_buff, pwd_buff) == EOF) return 0;
if (!strcmp(user_buff, user))
{
if (real_pwd) strcpy(real_pwd, pwd_buff);
return 1;
}
}
fclose(file);
return 0;
}
int add(char* user, char* pwd, double coin_n)
{
FILE* file;
file = fopen(cFile, "a");
if (!file) return 0;
fprintf(file, "%s %s %.2lf\n", user, pwd, coin_n);
fclose(file);
return 0;
}
int wenjian(char* user, char* pwd,double coin)
{
if (search(user, pwd, NULL)) return 0;
else add(user, pwd, coin);
return 1;
}
zhuce()/*注册*/
{
struct bank *p;
int i=0,k=0,judge1,judge2;
char name[30];
char sex,ch;
char sh[18];
int n;
p=(struct bank*)malloc(sizeof(struct bank));/*给p分配内存*/
welcome2();
printf("请输入您的名字(纯英文):");
gets(name);
printf("请输入您的性别(男:1 女2):");
fflush(stdin);
scanf("%c",&sex);
fflush(stdin);
printf("请输入您的身份证号码:");
gets(sh);
for(n=0;n<strlen(name);n++)/*判断输入信息是否正确*/
{
if(name[n]>='0'&&name[n]<='9')
{
printf("您输入的名字有误!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
}
if(sex!='1'&&sex!='2')/*判断输入信息是否正确*/
{
printf("您输入的性别不对!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
if(strlen(sh)!=18)/*判断输入信息是否正确*/
{
printf("您输入的身份证号码不全!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
for(n=0;n<strlen(sh)-1;n++)/*判断输入信息是否正确*/
{
if(sh[n]<48||sh[n]>57)
{
printf("您输入的身份证号码非法!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
else
{
if(sh[18]!='x'&&sh[18]<48&&sh[18]>57)
{
printf("您输入的身份证号码非法!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
}
}
printf("请输入您的帐号(10位纯数字):\n");
fflush(stdin);
scanf("%s",p->id);
fflush(stdin);
while(i <strlen(p->id))
{
if((p->id[i] < 48) || (p->id[i] > 57))
{
judge1=0;
}
i++;
}
while(strlen(p->id)!=10 ||judge1==0)/*判断帐号的正确性*/
{
printf("您输入的帐号不正确,必须为10位纯数字!");
printf("请重新输入(10位纯数字):");
fflush(stdin);
scanf("%s",p->id);
fflush(stdin);
}
printf("请输入您的密码(6位纯数字):\n");
fflush(stdin);
scanf("%s",p->psw);
fflush(stdin);
while(k <strlen(p->psw))
{
if((p->psw[k] < 48) || (p->psw[k] > 57))
{
judge2=0;
}
k++;
}
while(strlen(p->psw)!=6 ||judge2==0)/*判断密码形式的正确性*/
{
printf("您输入不正确!密码必须为6位纯数字!\n");
printf("请重新输入密码(6位纯数字):");
fflush(stdin);
scanf("%s",p->psw);
fflush(stdin);
}
printf("请输入您的首期存款:");
fflush(stdin);
scanf("%lf",&p->money);
fflush(stdin);
while((p->money)<100)
{
printf("您必须存入100元以上,请重新输入:");
fflush(stdin);
scanf("%lf",&p->money);
fflush(stdin);
}
if (wenjian(p->id,p->psw,p->money))/*存入文件并输出基本信息*/
{
system("cls");
printf("注册成功!");
printf("您的注册信息如下,请牢记:\n");
printf("名字:");
puts(name);
printf("性别代码:%c\n",sex);
printf("身份证号码:");
puts(sh);
printf("帐号:");
puts(p->id);
printf("密码:");
puts(p->psw);
printf("您帐户里的余额为:%.2lf\n",p->money);
printf("请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
else/*如有相同帐号,注册失败*/
{
system("cls");
printf("您输入的帐号已经存在!注册失败!\n");
printf("请选择:按1返回主页面. 按任意键退出:");
scanf("%c",&ch);
if(ch=='1'){system("cls");main();}
else exit(0);
}
}
gongneng(char Account[10+1],char Password[6+1],double Money)/*登陆成功后的功能界面*/
{
FILE *ps;
struct bank xin[1000];
int k=0,b=0;
char mima[6+1],Chiose,x;
char count[10+1],word[6+1];
double inmoney,outmoney,addmoney;
welcome3();
fflush(stdin);
scanf("%c",&Chiose);
fflush(stdin);
ps=fopen(cFile,"r");
if (!ps)
{
printf("不能打开文件!按任意键退出!");
fflush(stdin);
scanf("%c",&x);
fflush(stdin);
exit(0);
}
if(Chiose=='1')
{
printf("输入您的取款金额:");
fflush(stdin);
scanf("%lf",&outmoney);
fflush(stdin);
while(!feof(ps))
{
fscanf(ps, "%s %s %lf",&xin[k].id,&xin[k].psw,&xin[k].money);
k++;
}
fclose(ps);
ps=fopen(cFile,"wb");
if (!ps)
{
printf("不能打开文件!按任意键退出!");
fflush(stdin);
scanf("%c",&x);
fflush(stdin);
exit(0);
}
while(!feof(ps))
{
//printf("%s %s %.2lf\n",xin[b].id,xin[b].psw,xin[b].money);
if ((strcmp(Account, xin[b].id)==0)&&(strcmp(Password, xin[b].psw)==0))
{
xin[b].money=xin[b].money-outmoney;
}
printf("%.2lf\n",xin[b].money);
fprintf(ps, "%s %s %.2lf\n", xin[b].id, xin[b].psw, xin[b].money);
b++;
}
}
}
denglu()/*登陆*/
{
FILE *fp;
char account[10+ 1],password[6 + 1],h;
int m=0;
char real_account[10+ 1]; /* 帐号缓存 */
char real_password[6 + 1]; /* 密码缓存*/
double real_money_o=0.0; /*存款缓存*/
printf("请输入您的帐号(10位纯数字):");
gets(account);
printf("请输入您的密码(6位纯数字):");
gets(password);
fp = fopen(cFile, "r");
if (!fp)
{
printf("不能打开文件!按任意键退出!");
fflush(stdin);
scanf("%c",&h);
fflush(stdin);
exit(0);
}
while (m<=2) /*判断是否输入错3次了*/
{
while(fscanf(fp, "%s %s %lf", &real_account, &real_password,&real_money_o) != EOF) /*循环判断帐号密码*/
{
if ((strcmp(real_account, account)==0)&&(strcmp(real_password, password)==0))
{
system("cls");
printf("登陆成功!");
gongneng(real_account,real_password,real_money_o);
fclose(fp);
return 0;
}
}
rewind(fp); /*重新打开文件,进行新一轮的密码验证*/
printf("您输入的帐号不存在或密码不正确!\n请重新输入:\n");
m++;
printf("请输入您的帐号(10位纯数字):");
fflush(stdin);
gets(account);
fflush(stdin);
printf("请输入您的密码(6位纯数字):");
fflush(stdin);
gets(password);
fflush(stdin);
}
fclose(fp);
printf("您输入帐号密码不正确已经3次,您被强制退出系统(按任意键退出)!");
fflush(stdin);
scanf("%c",&h);
fflush(stdin);
exit(0);
}
int main()
{
char chiose;
welcome1();
scanf("%c",&chiose);
getchar();
if(chiose <='0' ||chiose>='4')
{
while(chiose <='0' || chiose>='4')
{
printf("您的输入有误,请重新输入:");
scanf("%c",&chiose);
getchar();
}
}
if(chiose=='1')
{
system("cls");
zhuce();/*注册*/
}
if(chiose=='2')
{
system("cls");
denglu();/*登陆*/
}
if(chiose=='3')
{
printf("谢谢您的使用!");
exit(0);
}
} -
2021-04-05 13:00 龙安隆 客户经理
简单的管理系统代码(按照你的要求:输入输出加查找)
优化如下:
#include<stdio.h>
#include<string.h>
struct bank{
char name[20];
char num[20];
double money;
};
int input(struct bank gusts[],int n);
void output(struct bank gusts[],int n);
void find(struct bank gusts[],int n);
int main()
{
struct bank gusts[100];
int n,choose;
printf("请输入要录入数据条数:");
scanf("%d",&n);
input(gusts,n);
printf("按照提示选择相应的操作!\n");
while(1)
{
printf("1:查找 2输出 0结束\n");
scanf("%d",&choose);
if(choose==0)
break;
switch(choose){
case 1:find(gusts,n);break;
case 2:output(gusts,n);break;
default:printf("无此操作!\n");break;
}
}
return 0;
}
int input(struct bank gusts[],int n)
{
int i;
if(n>100)
{
printf("数据过多!\n");
return 0;
}
printf("按以下格式输入%d条数据!\n",n);//加了一条提示
printf("姓名 账号 金额 \n");
for(i=0;i<n;i++)
{
scanf("%s %s %lf",gusts[i].name,gusts[i].num,&gusts[i].money);//账号不要带空格
}
printf("成功录入%d条账户数据!\n",n);
return 0;
}
void output(struct bank gusts[],int n)
{
int i;
printf("姓名 账号 金额 \n");
for(i=0;i<n;i++)
{
printf("%d:%s %s %0.3lf\n",i+1,gusts[i].name,gusts[i].num,gusts[i].money);
}
printf("成功输出所有账户数据!\n");
}
void find(struct bank gusts[],int n)
{
int i,choose;
int count;
char name[20],num[20];
printf("请输入查找类型对应的数字编号[1-3]:1姓名查找 2账户查找 3编号查找 4结束查找:\n");
while(1){
scanf("%d",&choose);
if(choose==4)
break;
else if(choose<1||choose>3)
{
printf("无此种查找!请重新选择!\n");
continue;
}
count=0;
switch(choose){
case 1:
printf("请输入查找的客户姓名:");
scanf("%s",name);
printf("查询结果如下:\n姓名 账户 编号\n");
for(i=0;i<n;i++)
{
if(strcmp(gusts[i].name,name)==0)
{
printf("%d:%s %s %0.3lf\n",i+1,gusts[i].name,gusts[i].num,gusts[i].money);
count++;
}
}
printf("共查询到%d条结果!\n",count);//加入结果统计
break;
case 2:
printf("请输入查找的客户账户:");
scanf("%s",num);
printf("查询结果如下:\n姓名 账户 编号\n");
for(i=0;i<n;i++)
{
if(strcmp(gusts[i].num,num)==0)
{
count++;
printf("%d:%s %s %0.3lf\n",i+1,gusts[i].name,gusts[i].num,gusts[i].money);
}
}
printf("共查询到%d条结果!\n",count);//加入结果统计
break;
case 3:
printf("请输入查找的客户编号:");
scanf("%d",&i);
printf("查询结果如下:\n姓名 账户 编号\n");
printf("%d:%s %s %0.3lf\n",i+1,gusts[i].name,gusts[i].num,gusts[i].money);
break;
}
}
}运行截图:
-
2021-04-05 12:57 辛培勇 客户经理
#include <conio.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
char cFile[] = "date.txt";
struct bank
{
char id[10+1];
char psw[6+1];
double money;
};
welcome1()
{
printf("\n\n\t\t欢迎使用虚拟银行自动取款机服务!\t\t\n\n");
printf("请选择功能:\n");
printf("\n=================================================\n");
printf(" || 请输入序号 ||\n");
printf(" || 1.新用户开户。 ||\n");
printf(" || 2.老用户登陆。 ||\n");
printf(" || 3.退出系统。 ||\n");
printf("=================================================\n");
}
welcome2()
{
printf("\n\n\t\t注册须知\n\n");
printf("**************************************************\n");
printf("* 1.请填写您的真实资料! *\n");
printf("* 2.开户首期必须存入100元以上 *\n");
printf("**************************************************\n");
}
welcome3()
{
printf("\n\n\t\t\3 欢迎进入虚拟银行系统 \3\n\n");
printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\n");
printf("\1\1\t 请选择功能:1.取款(最多透资2000); \1\1\n");
printf("\1\1\t 2.存款; \1\1\n");
printf("\1\1\t 3.查询余额; \1\1\n");
printf("\1\1\t 4.修改密码; \1\1\n");
printf("\1\1\t 5.返回主页面; \1\1\n");
printf("\1\1\t 任意键退出. \1\1\n");
printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\n");
}
int search(char* user, char* pwd, char* real_pwd)/*判断帐号是否相同,不相同返回1*/
{
FILE* file;
char user_buff[256], pwd_buff[256];
file = fopen(cFile, "r");
if (!file) return 0;
while (!feof(file))
{
if (fscanf(file, "%s%s\n", user_buff, pwd_buff) == EOF) return 0;
if (!strcmp(user_buff, user))
{
if (real_pwd) strcpy(real_pwd, pwd_buff);
return 1;
}
}
fclose(file);
return 0;
}
int add(char* user, char* pwd, double coin_n)
{
FILE* file;
file = fopen(cFile, "a");
if (!file) return 0;
fprintf(file, "%s %s %.2lf\n", user, pwd, coin_n);
fclose(file);
return 0;
}
int wenjian(char* user, char* pwd,double coin)
{
if (search(user, pwd, NULL)) return 0;
else add(user, pwd, coin);
return 1;
}
zhuce()/*注册*/
{
struct bank *p;
int i=0,k=0,judge1,judge2;
char name[30];
char sex,ch;
char sh[18];
int n;
p=(struct bank*)malloc(sizeof(struct bank));/*给p分配内存*/
welcome2();
printf("请输入您的名字(纯英文):");
gets(name);
printf("请输入您的性别(男:1 女2):");
fflush(stdin);
scanf("%c",&sex);
fflush(stdin);
printf("请输入您的身份证号码:");
gets(sh);
for(n=0;n<strlen(name);n++)/*判断输入信息是否正确*/
{
if(name[n]>='0'&&name[n]<='9')
{
printf("您输入的名字有误!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
}
if(sex!='1'&&sex!='2')/*判断输入信息是否正确*/
{
printf("您输入的性别不对!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
if(strlen(sh)!=18)/*判断输入信息是否正确*/
{
printf("您输入的身份证号码不全!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
for(n=0;n<strlen(sh)-1;n++)/*判断输入信息是否正确*/
{
if(sh[n]<48||sh[n]>57)
{
printf("您输入的身份证号码非法!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
else
{
if(sh[18]!='x'&&sh[18]<48&&sh[18]>57)
{
printf("您输入的身份证号码非法!\n");
printf("\n请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
}
}
printf("请输入您的帐号(10位纯数字):\n");
fflush(stdin);
scanf("%s",p->id);
fflush(stdin);
while(i <strlen(p->id))
{
if((p->id[i] < 48) || (p->id[i] > 57))
{
judge1=0;
}
i++;
}
while(strlen(p->id)!=10 ||judge1==0)/*判断帐号的正确性*/
{
printf("您输入的帐号不正确,必须为10位纯数字!");
printf("请重新输入(10位纯数字):");
fflush(stdin);
scanf("%s",p->id);
fflush(stdin);
}
printf("请输入您的密码(6位纯数字):\n");
fflush(stdin);
scanf("%s",p->psw);
fflush(stdin);
while(k <strlen(p->psw))
{
if((p->psw[k] < 48) || (p->psw[k] > 57))
{
judge2=0;
}
k++;
}
while(strlen(p->psw)!=6 ||judge2==0)/*判断密码形式的正确性*/
{
printf("您输入不正确!密码必须为6位纯数字!\n");
printf("请重新输入密码(6位纯数字):");
fflush(stdin);
scanf("%s",p->psw);
fflush(stdin);
}
printf("请输入您的首期存款:");
fflush(stdin);
scanf("%lf",&p->money);
fflush(stdin);
while((p->money)<100)
{
printf("您必须存入100元以上,请重新输入:");
fflush(stdin);
scanf("%lf",&p->money);
fflush(stdin);
}
if (wenjian(p->id,p->psw,p->money))/*存入文件并输出基本信息*/
{
system("cls");
printf("注册成功!");
printf("您的注册信息如下,请牢记:\n");
printf("名字:");
puts(name);
printf("性别代码:%c\n",sex);
printf("身份证号码:");
puts(sh);
printf("帐号:");
puts(p->id);
printf("密码:");
puts(p->psw);
printf("您帐户里的余额为:%.2lf\n",p->money);
printf("请选择:按1返回主页面. 按任意键退出:");
fflush(stdin);
scanf("%c",&ch);
fflush(stdin);
if(ch=='1'){system("cls");main();}
else exit(0);
}
else/*如有相同帐号,注册失败*/
{
system("cls");
printf("您输入的帐号已经存在!注册失败!\n");
printf("请选择:按1返回主页面. 按任意键退出:");
scanf("%c",&ch);
if(ch=='1'){system("cls");main();}
else exit(0);
}
}
gongneng(char Account[10+1],char Password[6+1],double Money)/*登陆成功后的功能界面*/
{
FILE *ps;
struct bank xin[1000];
int k=0,b=0;
char mima[6+1],Chiose,x;
char count[10+1],word[6+1];
double inmoney,outmoney,addmoney;
welcome3();
fflush(stdin);
scanf("%c",&Chiose);
fflush(stdin);
ps=fopen(cFile,"r");
if (!ps)
{
printf("不能打开文件!按任意键退出!");
fflush(stdin);
scanf("%c",&x);
fflush(stdin);
exit(0);
}
if(Chiose=='1')
{
printf("输入您的取款金额:");
fflush(stdin);
scanf("%lf",&outmoney);
fflush(stdin);
while(!feof(ps))
{
fscanf(ps, "%s %s %lf",&xin[k].id,&xin[k].psw,&xin[k].money);
k++;
}
fclose(ps);
ps=fopen(cFile,"wb");
if (!ps)
{
printf("不能打开文件!按任意键退出!");
fflush(stdin);
scanf("%c",&x);
fflush(stdin);
exit(0);
}
while(!feof(ps))
{
//printf("%s %s %.2lf\n",xin[b].id,xin[b].psw,xin[b].money);
if ((strcmp(Account, xin[b].id)==0)&&(strcmp(Password, xin[b].psw)==0))
{
xin[b].money=xin[b].money-outmoney;
}
printf("%.2lf\n",xin[b].money);
fprintf(ps, "%s %s %.2lf\n", xin[b].id, xin[b].psw, xin[b].money);
b++;
}
}
}
denglu()/*登陆*/
{
FILE *fp;
char account[10+ 1],password[6 + 1],h;
int m=0;
char real_account[10+ 1]; /* 帐号缓存 */
char real_password[6 + 1]; /* 密码缓存*/
double real_money_o=0.0; /*存款缓存*/
printf("请输入您的帐号(10位纯数字):");
gets(account);
printf("请输入您的密码(6位纯数字):");
gets(password);
fp = fopen(cFile, "r");
if (!fp)
{
printf("不能打开文件!按任意键退出!");
fflush(stdin);
scanf("%c",&h);
fflush(stdin);
exit(0);
}
while (m<=2) /*判断是否输入错3次了*/
{
while(fscanf(fp, "%s %s %lf", &real_account, &real_password,&real_money_o) != EOF) /*循环判断帐号密码*/
{
if ((strcmp(real_account, account)==0)&&(strcmp(real_password, password)==0))
{
system("cls");
printf("登陆成功!");
gongneng(real_account,real_password,real_money_o);
fclose(fp);
return 0;
}
}
rewind(fp); /*重新打开文件,进行新一轮的密码验证*/
printf("您输入的帐号不存在或密码不正确!\n请重新输入:\n");
m++;
printf("请输入您的帐号(10位纯数字):");
fflush(stdin);
gets(account);
fflush(stdin);
printf("请输入您的密码(6位纯数字):");
fflush(stdin);
gets(password);
fflush(stdin);
}
fclose(fp);
printf("您输入帐号密码不正确已经3次,您被强制退出系统(按任意键退出)!");
fflush(stdin);
scanf("%c",&h);
fflush(stdin);
exit(0);
}
int main()
{
char chiose;
welcome1();
scanf("%c",&chiose);
getchar();
if(chiose <='0' ||chiose>='4')
{
while(chiose <='0' || chiose>='4')
{
printf("您的输入有误,请重新输入:");
scanf("%c",&chiose);
getchar();
}
}
if(chiose=='1')
{
system("cls");
zhuce();/*注册*/
}
if(chiose=='2')
{
system("cls");
denglu();/*登陆*/
}
if(chiose=='3')
{
printf("谢谢您的使用!");
exit(0);
}
} -
2021-04-05 12:54 赵马元 客户经理
考试是吧!!你咋学的c++ -
2021-04-05 12:51 车广伟 客户经理
一般没有用C写的代码,C是面向过程,这个比较大要用面向对象,C++比较合适 -
2021-04-05 12:48 齐春春 客户经理
使用 C 语言编写一个银行帐户管理系统?你的这个编程要求实在是太高了,肯定是不会有人满足你的要求的。
因为这个要求已经不是简单地答疑 C 语言的语法错误之类的问题了,而是需要从头设计整个该帐户管理系统的各种数据存储结构、以及各种算法(在编写此软件的过程中,肯定需要涉及:到底采用哪一种排序算法效率最高、以及采取哪一种查找算法对人员进行查询效率最高),并且要想彻底从编写一个源程序,到编译、链接、直到该应用软件能够运行出用户所要求的最终正确结果,那是需要花费很多的时间和精力去调试的,而不是只要写出程序代码,即使程序的编程思路是正确的,也不一定能够保证程序的运行结果是正确的。 -
2021-04-05 12:44 管火金 客户经理
内容来自用户:肖远航110
银行账户管理系统是针对银行账户的日常管理而设计,操作方便而且界面简洁,使用较为简单的C语言作为编程语言,采用软件工程的开发原理,按照需求分析、概要设计、详细设计、程序编码、软件测试等过程进行规范设计。本银行账户管理系统具有良好的容错性,在出现误操作时能及时的给出相关错误提示,以便于用户及时地更正。此方案运用C语言设计的简易的银行账户管理系统,具体实现的功能有显示用户在银行留下的账户信息,以及选择账户查询的功能对用户存取款记录进行查询,可以比较清晰的反映出所要查询的内容。
关键词账户管理C语言 查询
目录
银行账户管理系统C语言程序设计I摘要I1需求分析31.1需求概述31.2需求环境31.3功能描述32概要设计42.1程序功能模块42.2程序流程图52.3数据的设计53详细设计63.1代码功能63.2功能实现代码63.3流程图94实际C语言代码135.运行结果245.1登陆界面245.2. .主菜单245.3.插入新账户255.4.列出所有账户255.5.查找账户存款信息265.6.删除账户265.7.取款265.8.存款276.问题与不足277.结语27参考文献28进入21世纪之后,随着科技的飞速发展和社会进步,尤其是计算机在大范围的普及,人工智能化的计算机应用也逐步的由大规模科学计算的海量数据处理转向大规模的事务处理和对工作流的管理,这就产生了以计算机为核心,以数据库管理系统为开发环境的管理信息系统在大规模的事务处理和对工作流的管理等方面的应用,特别是在银行账户管理之中的应用日益受到人
没有满意答案?看看这些问答能否帮助您?
相关百科精选
安华保险 安华农业保险股份有限公司是在...
中国财产再保险股份有限公司 中国财产再保险股份有限公司由中国再保险(集团)公司作为主发起人、吸收境内外6家投资人共同发起、于2003年12月15日成立的一家专业财产再保险公司,注册资本8亿元人民币;2005年10月,增资6.5亿元人民币,
已有 86485 位专家入驻汇财吧问答
已经帮助 1173961 人解决了问题
